Skip to content

Why PR #478 from 2013 fixing the use of URL separator (slash) has never been commited to master/main ? #2923

Answered by davidism
ypapouin asked this question in Q&A
Discussion options

You must be logged in to vote

It's not possible to fix in Flask or Werkzeug. Many popular HTTP servers, such as Apache httpd and Nginx, do this by default, so by the time it gets to us the URL is already decoded. We can't know what proxies are above the application and what they're doing, so we have to assume the lowest common denominator and treat slashes as decoded. Otherwise, users could go from dev to prod and get different routing behavior and not know why.

See django/asgiref#87, pallets/flask#2507, pallets/flask#900, #21, and other previous discussions.

The dev server, and some production servers, provide the non-standard REQUEST_URI or RAW_URI in the environ. If you know for sure that all proxies above you when…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ypapouin
Comment options

Answer selected by ypapouin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants