FAQ: explain the case where URL path contains escaped slash `%2F`
See original GitHub issueFor example, i’ve set up the following route with field expression:
/user/{name}
However sometimes the variable will contains slashes /
, such as:
/user/foo/bar
I know the slash character is a reserved character of URL, so i encoded my request URL as below:
/user/foo%2Fbar
I was expecting receiving the argument name
with value foo/bar
in responder method, but instead, i got a 404 error.
Issue Analytics
- State:
- Created 2 years ago
- Comments:16 (9 by maintainers)
Top Results From Across the Web
Is a slash ("/") equivalent to an encoded slash ("%2F") in the ...
Usually a URL has the same interpretation when an octet is represented by a character and when it encoded. However, this is not...
Read more >URL escape codes
Character URL Escape Codes String Literal Escape Code
SPACE %20 $20
< %3C $3C
> %3E $3E
Read more >Using a Slash Character in Spring URLs - Baeldung
Learn several ways to deal with URLs containing slash characters in Spring.
Read more >If an URL path element contains %2F (an escaped "/") Flask ...
If an URL path element contains %2F (an escaped "/") Flask.route considers it as an unescaped slash. #900.
Read more >A Complete Guide To URL Escape Characters
Contract Web Development explains the strange characters in your address bar, known as URL escape characters, and presents a table of the ...
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
Yes, but note that Werkzeug added this behaviour to their dev server, but not to parsing of the request path.
Their updated docs state:
Which what this issue is about, just for Falcon – documenting this, and adding recipes not dissimilar to what I’ve provided in my comments above 😈
Great! I think first class support will still be nice but the recipe is a good step for people who need this now.