Skip to content

Remove trailing slash redirects - #1119

Merged
davidpdrsn merged 18 commits into
mainfrom
remove-tsr
Jun 29, 2022
Merged

Remove trailing slash redirects#1119
davidpdrsn merged 18 commits into
mainfrom
remove-tsr

Conversation

@davidpdrsn

Copy link
Copy Markdown
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
Comment thread axum/CHANGELOG.md Outdated
Comment thread axum/src/routing/tests/mod.rs
@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
Copy Markdown
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 😅

Comment thread axum-extra/src/routing/mod.rs Outdated
Comment thread axum-extra/src/routing/mod.rs
Comment thread axum-extra/src/routing/mod.rs Outdated
Comment thread axum-extra/src/routing/mod.rs Outdated
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
Comment thread axum/CHANGELOG.md Outdated
Comment thread axum/CHANGELOG.md Outdated
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