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

PoC change behavior of nesting with regards to trailing slashes and root route #2730

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

Conversation

mladedav
Copy link
Collaborator

@mladedav mladedav commented May 5, 2024

Ref #2651 and #2659

Motivation

Nesting at /foo and /foo/ is almost the same but isn't consistent in whether the root route is at /foo or at /foo/.

More discussion is in #2659

Solution

This is one possible solution which:

  • disallows nesting at routes ending with a slash. So nesting at /foo/ is disallowed.
  • allows overriding where the root route would be accessible with a specialized method. At /foo, /foo/, or both. The default is both to make it consistent with nest_service, but could also be /foo to not change the behavior (the previous point is already breaking change though).

This would need some cleaning up (e.g. fixing all tests that nest at paths ending with slashes). Also, all endpoints are now needlessly cloned during nesting just because we might need to clone the root one so that's one thing I'd like to solve better if we wanted to go in this direction.

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.

1 participant