Musnad Ahmad 1341
It was narrated that Abu `Abdur-Rahman as-Sulami said:
`Ali (رضي الله عنه )addressed us and said:  O people, carry out the hadd punishments on your slaves, both those who have been married and those who have not been married, for a slave woman of the Messenger of Allah (ﷺ) committed zina and the Messenger of Allah (ﷺ) ordered me to carry out the hadd Punishment on her. I went to her and found that she was still bleeding following childbirth, and I was afraid that if I flogged her she would die So I went to the Messenger of Allah (ﷺ) and told him about that, and he said: “You have done well.”
حَدَّثَنَا سُلَيْمَانُ بْنُ دَاوُدَ، أَنْبَأَنَا زَائِدَةُ، عَنِ السُّدِّيِّ، عَنْ سَعْدِ بْنِ عُبَيْدَةَ، عَنْ أَبِي عَبْدِ الرَّحْمَنِ السُّلَمِيِّ، قَالَ خَطَبَنَا عَلِيٌّ رَضِيَ اللَّهُ عَنْهُ قَالَ يَا أَيُّهَا النَّاسُ أَقِيمُوا عَلَى أَرِقَّائِكُمْ الْحُدُودَ مَنْ أُحْصِنَ مِنْهُمْ وَمَنْ لَمْ يُحْصَنْ فَإِنَّ أَمَةً لِرَسُولِ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ زَنَتْ فَأَمَرَنِي رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ أَنْ أُقِيمَ عَلَيْهَا الْحَدَّ فَأَتَيْتُهَا فَإِذَا هِيَ حَدِيثُ عَهْدٍ بِنِفَاسٍ فَخَشِيتُ إِنْ أَنَا جَلَدْتُهَا أَنْ تَمُوتَ فَأَتَيْتُ رَسُولَ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ فَذَكَرْتُ ذَلِكَ لَهُ فَقَالَ أَحْسَنْتَ‏.‏