וַיְהִ֤י יְהוָה֙ אֶת־יוֹסֵ֔ף וַיֵּ֥ט אֵלָ֖יו חָ֑סֶד וַיִּתֵּ֣ן חִנּ֔וֹ בְּעֵינֵ֖י שַׂ֥ר בֵּית־הַסֹּֽהַר׃
But the LORD was with Joseph, and showed kindness unto him, and gave him favour in the sight of the keeper of the prison.
Read halakhic rulings (Jewish law) on Genesis 39:21: and classical halakhic sources.