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

"/*path" does not match "/" anymore with axum 0.6 ... #1607

Closed
nicolaspernoud opened this issue Dec 2, 2022 · 2 comments
Closed

"/*path" does not match "/" anymore with axum 0.6 ... #1607

nicolaspernoud opened this issue Dec 2, 2022 · 2 comments

Comments

@nicolaspernoud
Copy link

Bug Report

Version

v0.6.1

Platform

Linux 5.19.0-26-generic #27-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov 23 20:44:15 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Description

Creating a router with :

 let mut router = Router::new()
            .route(
                "/*path", ....

Used to match an empty path ("/"), but with axum 0.6 it does not work anymore...

@davidpdrsn
Copy link
Member

Wildcards not matching just a slash is an intentional change. From the changelog:

The request /foo/ no longer matches /foo/*rest. If you want to match /foo/ you have to add a route specifically for that (#1086)

You have to add routes for both / and /*path or just use Router::fallback to catch everything.

@davidpdrsn davidpdrsn closed this as not planned Won't fix, can't repro, duplicate, stale Dec 2, 2022
@nicolaspernoud
Copy link
Author

Ok, thanks for the quick answer, fallback does work well !

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

No branches or pull requests

2 participants