Fiqh-us-Sunnah Volume 3, Zakaat and Fasting, Fiqh 3.135.

Section : Fasting, cupping to drain blood.

The Prophet, upon whom be peace, was cupped while he was fasting. However, if doing this weakens the fasting person, it is disliked. Thabit al-Bunani asked Anas: “Did you dislike cupping for a fasting person during the time of the Prophet?” He answered: “No [we did not], unless it made someone weak.” This is related by al-Bukhari and others. Vivisection follows the same ruling as cupping.