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

Groups of slashes in path should be normalized and redirected #1132

Closed
davidism opened this issue Jun 5, 2017 · 3 comments · Fixed by #1286
Closed

Groups of slashes in path should be normalized and redirected #1132

davidism opened this issue Jun 5, 2017 · 3 comments · Fixed by #1286
Labels
Milestone

Comments

@davidism
Copy link
Member

davidism commented Jun 5, 2017

Originally reported at pallets/flask#1323.

/x and //x should route to the same location, possibly by redirecting. From the linked issue:

On most operating systems, extra slashes resolve to one. URLs came from file system notation so it would seem that the two should respond in the same way.

Apache removes duplicate slashes for a good reason.

Nginx has the merge_slashes directive, which is on by default.

RFC 3986 seems to imply you can't have multiple, contiguous slashes

Possible solution is to add a collapse_slashes option similar to strict_slashes.

Possibly related to #491.

@davidism
Copy link
Member Author

This should apply to defining rules (//x becomes /x internally) as well as matching incoming paths (//x redirects to /x).

@garlicbulb-puzhuo

This comment has been minimized.

@davidism

This comment has been minimized.

@davidism davidism added this to the 1.0.0 milestone Jan 5, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants