Skip to content

Commit

Permalink
Resolve pabluk#15
Browse files Browse the repository at this point in the history
  • Loading branch information
nutjob4life committed Mar 5, 2023
1 parent 486e477 commit cd73fdf
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion libgravatar/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,12 @@ def md5_hash(string):
'0bc83cb571cd1c50ba6f3e8a78ef1346'
"""
return md5(string.encode("utf-8")).hexdigest()
try:
# On security-restricted systems, indicate we are fingerprinting only:
return md5(string.encode("utf-8"), usedforsecurity=False).hexdigest()
except TypeError:
# On systems without usedforsecurity:
return md5(string.encode("utf-8")).hexdigest()


def default_url_is_valid(url):
Expand Down

0 comments on commit cd73fdf

Please sign in to comment.