Closed ScarStruck55 closed 5 years ago
Hey, Do you know if something has changed in HIBP api recently? Commit which fixes --> https://github.com/woj-ciech/Danger-zone/commit/4f7cfa8f0460161997c1250823e3429b20551ff9 Thanks!
Not exactly sure if it changed or not, but here is a quick link to all the responses and info on the API: https://haveibeenpwned.com/API/v2#ResponseCodes
Thanks for the quick commit and your work on this project!
I kept getting "Connection Error" for the haveibeenpwned module. I found the was in the handling of the response.
Starting @ line 108 - should be checking req_haveibeenpwned.status_code.
also per the api docs, status_code of 404 means the account wasn't found in their database.
Here's how I fixed it:
if req_haveibeenpwned.status_code != 200: if req_haveibeenpwned.status_code == 404: print "account not pwned" return False print "Connection error " + str(req_haveibeenpwned.status_code) +" " + req_haveibeenpwned.text return False