question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

FAQ: explain the case where URL path contains escaped slash `%2F`

See original GitHub issue

For 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:closed
  • Created 2 years ago
  • Comments:16 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
vytas7commented, May 18, 2021

Yes, but note that Werkzeug added this behaviour to their dev server, but not to parsing of the request path.

Their updated docs state:

If you want to route based on this value, you can use middleware to replace PATH_INFO in the environ before it reaches the application. However, keep in mind that these keys are non-standard and not guaranteed to be present.

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 😈

0reactions
flying-sheepcommented, Nov 15, 2021

Great! I think first class support will still be nice but the recipe is a good step for people who need this now.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found