You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ curl localhost:3000/foo%2Fbar
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><title>404 Not Found</title><h1>Not Found</h1><p>The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.</p>
A website has the URL rule /<string:company>/<string:user>. Company names and users would have to have the slash character disallowed otherwise they would not be able to be cleanly represented as a URL.
A Second Example
A second issue that I assume is directly related is that url_for doesn't escape the forward slash.
FYI, if you may be able to use <path:foo> to have a segment that can contain slashes. However, I think both company names and user names should be "slugified" (pure ascii, no weird chars, no whitespace, no slashes, other stuff converted to dashes) before being used in an URL. For example, you'd convert "Greedy Corp" to "greedy-corp" and "Slightly/Evil Org" to "slightly-evil-org"
Expected Behavior
When a forward slash (
/
) is percent encoded, it should not be treated as a delimiter in a URL but instead should be treated as a string character.Actual Behavior
Environment
Python 3.5.3
0.12.2
0.12.2
venv:
Use Case
A website has the URL rule
/<string:company>/<string:user>
. Company names and users would have to have the slash character disallowed otherwise they would not be able to be cleanly represented as a URL.A Second Example
A second issue that I assume is directly related is that
url_for
doesn't escape the forward slash.In the browser, submitting
foo/moarfoo
andbar
into the two fields yields the URL/foo/moarfoo/bar
instead of/foo%2Fmoarfoo/bar
.The text was updated successfully, but these errors were encountered: