Browse Source

Harmlessly ignore bad params to Libravatar

I was throwing 400s when bad parameters are provided, but the spec
actually says you're supposed to just ignore them entirely.
main
Danielle McLean 3 months ago
parent
commit
76496e7169
Signed by: 00dani GPG Key ID: 9DDE1EDE01E3A605
  1. 4
      users/views.py

4
users/views.py

@ -21,9 +21,9 @@ def libravatar(request, hash):
try:
size = int(size)
except ValueError:
return utils.bad_req('size parameter must be an integer')
size = 80
if not 1 <= size <= 512:
return utils.bad_req('size parameter must be between 1 and 512')
size = 512
if len(hash) == 32:
where = Q(email_md5=hash)

Loading…
Cancel
Save