AustralianSynchrotron / openday-scavenger

Open Day Scavenger Hunt App
BSD 3-Clause "New" or "Revised" License
1 stars 5 forks source link

Should `custom_http_exception_handler` return 404 when handling a 404? #74

Open luigiferiani opened 2 months ago

luigiferiani commented 2 months ago

I was testing an endpoint in my puzzle and raising a 404 on purpose. I was expecting a 404 in the response, but got a 200. The custom_http_exception_handler is catching my HTTPException and returning a templated 404 page, but the TemplateResponse has status 200.

https://github.com/AustralianSynchrotron/openday-scavenger/blob/ad7cc300c2b352b94e35bff23dd36e812fd33cc1/openday_scavenger/main.py#L105

Is that on purpose?

Possibly related to d669329758d72a495a792ee749483d65f5cb1bb5 in #64?