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

fix route_prefix leading slash handling #3759

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

fmigneault
Copy link

Fixes #3758

In summary, applies the proposed strip -> rstrip modification to route_prefix handling such that the resulting route_prefix in the configurator keeps the leading / if explicitly specified. If not specified (i.e.: route_prefix="prefix" instead of route_prefix="/prefix"), it results in the same behavior as before.

When merging/nesting multiple paths/routes onto each other, insertion of the / is applied automatically as needed (as it was before, but considering /prefix must be kept instead of prefix).

Added exhaustive test combinations for combining config.include(route_prefix=...), with config.route_prefix_context(route_prefix=...) with direct/nested configurators and with/without explicit leading slash.

@fmigneault
Copy link
Author

@mmerickel FYI

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.

Modify route_prefix_context to preserve leading slash
1 participant