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
Don't allow extracting MatchedPath
in middleware for nested routes
#1462
Conversation
It would be nice if the error returned by |
That would mean adding support for |
Yes, I agree. I don't think they would be able to handle it differently. I was thinking purely for discoverability of the fact that it won't work with nested routers. |
Co-authored-by: Jonas Platte <jplatte+git@posteo.de>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Outside of some small code style things, looks good!
dc4503b
to
e4e9507
Compare
This changes
MatchedPath
so it cannot be extracted in middleware of nested routes. This means users wont see the internal wildcard route (/nested/*__private__axum_nest_tail_param
) that actually matched. This is an implementation detail and shouldn't be exposed.I didn't make
MatchedPath
accessible in response extensions like discussed in #1441 because thats not a breaking change and shouldn't block shipping 0.6.0I also reworked the tests so there are multiple smaller tests instead of one big one. Should be easier to read.
Part of #1441