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

Don't allow extracting MatchedPath in fallbacks #1934

Merged
merged 2 commits into from
Apr 17, 2023

Conversation

davidpdrsn
Copy link
Member

With the introduction of PathRouter in #1711 I forgot that fallbacks
shouldn't be able to extract MatchedPath. The extension for it was
interested regardless if the PathRouter was used as a fallback or not.

It doesn't make sense to extract MatchedPath in a fallback because
there was no matched route. Turns out it also fixes a panic with a
specifical fallback/nest setup.

Fixes #1931

@davidpdrsn davidpdrsn requested a review from jplatte April 14, 2023 09:58
With the introduction of `PathRouter` in #1711 I forgot that fallbacks
shouldn't be able to extract `MatchedPath`. The extension for it was
interested regardless if the `PathRouter` was used as a fallback or not.

It doesn't make sense to extract `MatchedPath` in a fallback because
there was no matched route. Turns out it also fixes a panic with a
specifical fallback/nest setup.

Fixes #1931
@davidpdrsn davidpdrsn force-pushed the david/fix-nesting-fallback-panic branch from 32aaebe to cd09bf3 Compare April 14, 2023 09:58
@davidpdrsn davidpdrsn requested a review from jplatte April 14, 2023 10:13
@davidpdrsn davidpdrsn enabled auto-merge (squash) April 14, 2023 10:13
@davidpdrsn davidpdrsn merged commit 2c87d65 into main Apr 17, 2023
@davidpdrsn davidpdrsn deleted the david/fix-nesting-fallback-panic branch April 17, 2023 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Axum 0.6.15 seems to break ServeDir completely
2 participants