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

Panic when attempting to add a route_layer to an empty router #1327

Merged
merged 1 commit into from Aug 25, 2022

Conversation

jplatte
Copy link
Member

@jplatte jplatte commented Aug 25, 2022

Maybe we should also disallow / heavily discourage routers that only consist of a fallback and panic in the layer methods as well?

Copy link
Member

@davidpdrsn davidpdrsn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense! I've definitely heard some people who were tripped by this.

I think Router::new().layer(...) should be allowed, even though its a very roundabout way of handling all requests and adding a middleware to that.

@jplatte jplatte merged commit 92f6b68 into main Aug 25, 2022
@jplatte jplatte deleted the jplatte/panic-unused-layer branch August 25, 2022 13:42
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

Successfully merging this pull request may close these issues.

None yet

2 participants