It is narrated from Sayyiduna Ka'b bin Ujrah (may Allah be pleased with him) that he suffered an ailment of the head, so the Prophet (peace and blessings be upon him) ordered him to shave and give a cow as ransom.
Hadith Referenceالمعجم الكبير للطبراني / باب الكاف / 16413