Open syeopite opened 11 months ago
Looks like a bug to. me, thanks a lot for reporting @syeopite I'll put this as priority in my pipeline 👍
My initial findings show that Kemal::Config::INSTANCE.handlers
is not working as expected. Instead of respecting Kemal::Config::FILTER_HANDLERS
it just errors out flat. Changing the order of the filters didn't work either. Need to investigate if it's a special behavior to 404
My initial findings show that
Kemal::Config::INSTANCE.handlers
is not working as expected. Instead of respectingKemal::Config::FILTER_HANDLERS
it just errors out flat. Changing the order of the filters didn't work either. Need to investigate if it's a special behavior to404
Might be the exception handler short-circuiting the response and ignoring filter handlers
It seems, like the filter handler does not get the blocks if a route is not found? https://github.com/kemalcr/kemal/blob/cb9adcd188162f1e3c83ff98263d3587b9a2f9ab/src/kemal/filter_handler.cr#L16 Commenting that line seems to make the original example work, but from a quick search I could not find the reasoning for it to be there in the first place. Happy to try and put in a PR to fix if you give some pointers on why it's there.
Description
It seems like the
before_all
handler isn't called for the error routes.Steps to Reproduce
Take a simple project with a
before_all
handler:Query a route that doesn't exist such as
0.0.0.0:3000/route
Notice that the
before_all
handler isn't calledExpected behavior:
Actual behavior: [What actually happens]
Reproduces how often: [What percentage of the time does it reproduce?]
100% of the time
Versions