ubernostrum / pwned-passwords-django

Utilities for working with the Pwned Passwords database from Django.

Home Page:https://pwned-passwords-django.readthedocs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ValueError: invalid literal for int() with base 10: '//www.w3.org/TR/html4/strict.dtd">'

browniebroke opened this issue · comments

I'm using the following version, under Python 3.5:
pwned-passwords-django==1.1
django==1.11.13

Our prod monitoring just came through with the above error when we tried to verify someone's password, and the API came back with an HTML document starting with <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">, which made the password validator crash.

I cannot see the rest, but it looks like there was a small issue with the API at the time. I just retried the request manually, and the response is fine now.

Can I suggest to make the password validator a bit more resilient to API failures? If we fail to parse the response body, or if the response status code isn't 200, something went wrong and we should disable this validator.

This has already been fixed in #1 but there has not been a new version released.

@ubernostrum can you publish a new version?

I've missed that, thanks for pointing it out. A new release would be awesome, yes.