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

Fixes TSRs redirecting to toplevel inside nested Router #2993

Merged
merged 3 commits into from
Oct 17, 2024

Conversation

erin-desu
Copy link
Contributor

Originally, if you used route_with_tsr (let's say /nyan/) inside nested router (let's say /neko), it got redirected to /nyan/, where /neko/nyan/ was expected.

Fixed using OriginalUri instead of plain Uri.

Originally, if you used `route_with_tsr` (let's say `/nyan/`) inside
nested route (let's say `/neko`), it got redirected to `/nyan/`, where
`/neko/nyan/` was expected.

Fixed using `OriginalUri` instead of plain `Uri`.
@erin-desu
Copy link
Contributor Author

CI failure is not my fault 😭

Copy link
Collaborator

@mladedav mladedav left a comment

Choose a reason for hiding this comment

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

Looks good to me, we'll take care of the CI.

@jplatte this adds a dependency from axum-extra on axum's original-uri feature which adds one uri clone and adds a request extension to each request. I think that should be fine but wanted to doublecheck with you.

@jplatte
Copy link
Member

jplatte commented Oct 16, 2024

Hm, I find that a bit awkward. Maybe we should move route_with_tsr behind a feature flag (can be on by default)? Doesn't have to be in this PR though.

@erin-desu
Copy link
Contributor Author

Hm, I find that a bit awkward. Maybe we should move route_with_tsr behind a feature flag (can be on by default)? Doesn't have to be in this PR though.

Well, we are getting Axum 0.8 soon but it's already in alpha and idk if that's a change suited for it? If so i can add it in the fork.

@jplatte
Copy link
Member

jplatte commented Oct 17, 2024

Let's not worry about it in this PR. The way it is now, it can be backported to 0.7.

@mladedav mladedav merged commit 1143694 into tokio-rs:main Oct 17, 2024
18 checks passed
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.

3 participants