Skip to content

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 disabled auto-merge April 17, 2023 11:20
@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