Getting talked to for clothing at work

So I'm a college student, I work at my colleges library and I live close by so I'm working there for the summer also. It gets hot in the library and I work after hours, until 8pm and the AC goes off at 4pm. I wear tank tops and shorts to work cuz I want to be comfortable and cool (but I still try to look presentable). Today before my boss left she called me into her office and told me that someone from the first floor of the library saw my shorts last week and thought they were too short. And that I need to stop wearing short shorts. I tried to defend myself a little by saying that it gets hot but yes I understand and will not wear shorts anymore. But I feel so embarrassed 😩 I feel like a child that got scolded. To make matters worse my boss is just a little bit older than me and we're friends so it made me feel so unprofessional and childish. I'm so embarrassed!! Any advice?