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

Ability to return errors from middleware #2544

Open
justhaug opened this issue Jan 28, 2024 · 0 comments
Open

Ability to return errors from middleware #2544

justhaug opened this issue Jan 28, 2024 · 0 comments

Comments

@justhaug
Copy link

I have looked for existing issues (including closed) about this

Feature Request

I essentially want to have a middleware that doesn't send back a response or status code at all. Something like one of towers layers which load shed or do filters (which doesn't work because Layers must have Infallible responses).

Motivation

The reason for this is to immediately get rid of malicious requests with as little compute as possible.

Proposal

No idea if this should be included in axum considering what is written here and I am not familiar enough with the internals of axum to know if it can be implemented without changing lots of traits.

Alternatives

I can just return a response without a body, this issue isn't a blocker. Feel free to close if it doesn't align with axum's current approach.

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

1 participant