Anas bin Malik reported,

The reason cupping was first disliked for the fasting person is that Jafar bin Ubayy Talib was cupped while fasting, and the Prophet ﷺ passed by him and said, "These two have broken their fast." Then the Prophet ﷺ later granted permission for cupping while fasting, and Anas used to be cupped while fasting.

Azami 4582

Hasan

عن أنس بن مالك، قال

أول ما كرهت الحجامة للصائم أن جعفر ابن أبي طالب احتجم وهو صائم، فمر به النبي ﷺ فقال: أفطر هذان. ثم رخص النبي ﷺ بعد في الحجامة للصائم، وكان أنس يحتجم وهو صائم.

الأعظمي 4582حسن
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Fasting
Chapter
What is permitted and what is not permitted for the fasting person
Section
Concession regarding that
Numbering
Jami al-Kamil 4582 (2nd edition)
Azami 4582