Sahih Muslim
548.01

Abu Sa'id al-Khudri reported:The Apostle of Allah (ﷺ) saw sputum sticking to the Qibla of the mosque. He scratched it off with a pebble and then forbade spitting on the right side or in front, but (it is permissible) to spit on the left side or under the left foot

548.02

Abu Huraira and Abu Sa'id narrated that the Messenger of Allah (ﷺ) saw sputum, and the rest of the hadith is the same