Extra slashes causes route error
See original GitHub issueExtra slashes in the URL change the routing. For example, /x
and //x
do not route the same way.
Here’s a unit test which demonstrates this:
https://gist.github.com/robnagler/1a5d0361cc71a6806fc6
If you put a proxy in front of flask, it will normalize the URLs so this isn’t an issue. It would seem, however, that Flask should normalize the URLs as well.
Issue Analytics
- State:
- Created 9 years ago
- Comments:14 (10 by maintainers)
Top Results From Across the Web
What causes double slashes in url path?
Double slashes are usually caused by redirect rules. ... The problem is compounded by relative links once a crawler finds a URL with...
Read more >url with multiple forward slashes, does it break anything?
I have a script that parses URLs and i was wondering if it would break anything (or change the path) if i replaced...
Read more >"Double slash in URL" error in Site Audit | Help Center - Ahrefs
This issue reports all URLs that contain a double slash (after the domain part). Example: https://ahrefs.com/blog//. Why is it important? Most servers are ......
Read more >URL contains a double slash | Sitebulb
A double slash in the URL path is valid and will respond in the browser, but is typically unwelcome, as this could cause...
Read more >Why is a double slash valid in a file path? - Progress Community
A file path containing, two consecutive slashes, does not cause any kind of a run-time error. Why is this valid?
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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:
Note that
path-
* requiresegment-nz
. segment-nz requires at least onepchar
, which cannot be a slash.This is a Werkzeug issue, reported at pallets/werkzeug#1132.