Closed Martmists-GH closed 7 years ago
This is not an error. There is never a case where a server should decide to send a 404 and then resolve a 404 into a 200. That's not how the specification works.
So how do you suggest I add functionality like this whenever a page isn't found in the routes defined by the code?
You should either return a '404 page' like most sites or just return the 404 with no content and let the web browser give its own default not found page. To be clear, neither of these require you to return a 200. It's perfectly acceptable to return page content on a 404.
The logging call is before the error handler is hit.
If you want to do weird stuff like this, use a custom router, with the other changes in 1.10.
What I'm saying is that I want kyoukai to look if a file exists, and only 404 if even the file isn't found. I might get a lot of pages and I'm not gonna add routes to all of them (even regex would be too much)
That is not how a web server (or hell, even a file server) works. Thank you, please come again once you understand how these things work.
You can literally make a catch-all route with /(.*)
. It will catch ANY request not caught by other requests, as long as you define it LAST in the order.
Pls fix