aggrolite
Hey all...I've run into an issue regarding the API.

According to the documentation, if the given email address has not been compromised, a status of 404 is returned (see: )

When I submit an email that has been "pwned" I receive a status of 200 from the API and I'm able to see my Spice template. But when an email is not "pwned" a status of 404 is returned and Duckpan returns to the main search page with a message of "404 not found"

Any ideas of how I can catch this response before Duckpan just bails out?
posted by aggrolite 3 years and 10 months ago Link

aggrolite
the link to the documentation I meant to include: https://haveibeenpwned.com/API/v2#Respon...
posted by aggrolite 3 years and 10 months ago Link
Puskin
I tried with https://haveibeenpwned.com/api/v2/breach... , as you can see it returns nothing... I think you can check if the page is totally blank!
posted by Puskin 3 years and 10 months ago Link
aggrolite
Right...except when I visit that link in my browser I receive a 404 status.

$ perl -Mojo -E 'say g("https://haveibeenpwned.com/api/v2/breach...")->code'
404
posted by aggrolite 3 years and 10 months ago Link
Puskin
Wich result does the API call returns starting the Spice?
posted by Puskin 3 years and 10 months ago Link
aggrolite
Could you rephrase your question? I'm not sure what you're asking. In the case of an email not being "pwned" the API returns a status of 404. But Duckpan server seems to bail out of a search entirely when a 404 is encountered in any request (or at least in this request).
posted by aggrolite 3 years and 10 months ago Link