Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileMiddleware and 404 responses #592

Open
adam-fowler opened this issue Oct 14, 2024 · 2 comments
Open

FileMiddleware and 404 responses #592

adam-fowler opened this issue Oct 14, 2024 · 2 comments

Comments

@adam-fowler
Copy link
Member

Currently the FileMiddleware runs whenever the router throws a 404 HTTPError. It does not run if a Response is returned whose status is 404.

Should we consider a returned 404 responses as a reason to kick off the FileMiddleware? On one hand a returned response could be considered as already handled and therefore we shouldn't kick off the FileMiddleware. On the other people have been caught out by this.

Options:

  • Treat 404 responses the same as errors.
  • Add an option to treat 404 responses the same as errors.
  • Improve documentation.

@tib

@Joannis
Copy link
Member

Joannis commented Oct 21, 2024

Oh, interesting question! I'd vote for an option here, but think that this type of option is inherently so undiscoverable I don't think it'll be used in practice.

@tib
Copy link
Contributor

tib commented Oct 21, 2024

I would also like to have on the option to pick the desired behavior, plus improved documentation of course. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants