If there is a fever, you should stay at home and rest. You should out rule an infection you don’t want to spread the germs throughout the gym. If no fever present and you feel well enough then workout.
As always know your limitations, and listen to your body.