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

Clarify some subtleties of routing #2896

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

SabrinaJewson
Copy link
Contributor

Motivation

I was confused when using Axum of the following things:

  • whether nest("/foo") will match /foo and/or /foo/;
  • whether a fallback is called when the method is not allowed.

Solution

Document the behaviours.


Also relevant: #2659, #2251

Copy link
Member

@jplatte jplatte left a comment

Choose a reason for hiding this comment

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

Thanks for the PR, docs improvements are super welcome.
I'm not convinced it's completely correct though, see review comment below.

Also, sorry for the lag.

Comment on lines +86 to +87
paths `/foo` or `/foo/`, a nested router at `/foo` will match the path `/foo`
(but not `/foo/`), and a nested router at `/foo/` will match the path `/foo/`
Copy link
Member

Choose a reason for hiding this comment

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

I'm skeptical about a different bit here: A nested router at /foo will not match /foo/ (first parenthesis)? I'm pretty sure that's not right.

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