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

Remove trailing slash redirects #1119

Merged
merged 18 commits into from Jun 29, 2022
Merged

Remove trailing slash redirects #1119

merged 18 commits into from Jun 29, 2022

Conversation

davidpdrsn
Copy link
Member

Fixes #1118

@davidpdrsn davidpdrsn added breaking change A PR that makes a breaking change. A-axum labels Jun 25, 2022
@davidpdrsn davidpdrsn requested a review from jplatte June 25, 2022 19:35
axum/CHANGELOG.md Outdated Show resolved Hide resolved
axum/src/routing/tests/mod.rs Show resolved Hide resolved
@davidpdrsn davidpdrsn added this to the 0.6 milestone Jun 27, 2022
* Allow `Error: Into<Infallible>` for `Route::{layer, route_layer}` (#924)

* Allow `Error: Into<Infallible>` for `Route::{layer, route_layer}`

Fixes #922

* changelog

* fixup changelog
* Panic on overlapping routes in `MethodRouter`

* changelog link

* add test to ensure `head` and `get` don't overlap
@davidpdrsn davidpdrsn requested a review from jplatte June 27, 2022 19:16
@davidpdrsn davidpdrsn force-pushed the axum-next branch 2 times, most recently from f6dbabe to f6bab0f Compare June 28, 2022 19:35
Base automatically changed from axum-next to main June 28, 2022 20:07
@davidpdrsn davidpdrsn enabled auto-merge (rebase) June 28, 2022 20:15
@davidpdrsn
Copy link
Member Author

@jplatte I've added RouterExt::route_with_tsr. I figure we only need one method that can check whether the path from the user contains a trailing slash and then add the corresponding redirect route.

Re naming: The name isn't great but not sure route_with_trailing_slash_redirect is much better 😅

axum-extra/src/routing/mod.rs Outdated Show resolved Hide resolved
axum-extra/src/routing/mod.rs Show resolved Hide resolved
axum-extra/src/routing/mod.rs Outdated Show resolved Hide resolved
axum-extra/src/routing/mod.rs Outdated Show resolved Hide resolved
davidpdrsn and others added 2 commits June 29, 2022 20:36
Co-authored-by: Jonas Platte <jplatte+git@posteo.de>
Co-authored-by: Jonas Platte <jplatte+git@posteo.de>
@davidpdrsn davidpdrsn requested a review from jplatte June 29, 2022 18:37
axum/CHANGELOG.md Outdated Show resolved Hide resolved
axum/CHANGELOG.md Outdated Show resolved Hide resolved
davidpdrsn and others added 2 commits June 29, 2022 23:12
@davidpdrsn davidpdrsn requested a review from jplatte June 29, 2022 21:36
auto-merge was automatically disabled June 29, 2022 22:13

Rebase failed

@davidpdrsn davidpdrsn merged commit a4c8204 into main Jun 29, 2022
@davidpdrsn davidpdrsn deleted the remove-tsr branch June 29, 2022 22:22
@mladedav mladedav mentioned this pull request Mar 17, 2024
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-axum breaking change A PR that makes a breaking change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider removing support for trailing slash redirects
2 participants