Comments (4)
The problem here is that this is still undefined behavior. A conforming WSGI implementation cannot give you the information if %2f or / was used in the URL so the reversal of that URL would not match unless path: is used in which case / is fine again.
from werkzeug.
Then why not leave that trouble for the WSGI middleware. The matcher is able to make the difference between %2f and / as you can see there:
http://paste.pocoo.org/show/319607/
Why shouldn't we do what locally (at the Map level) makes sense, not caring about which environment we might actually be running in ...
I'm still in favor of my patch (or similar).
from werkzeug.
Because Werkzeug is a WSGI library. The path passed to the match method is already unescaped, so at that point there is no %2f any more.
from werkzeug.
I made some tests and read a bit around, it and turns out that among all the servers I tested, Apache mod_wsgi is the only one behaving "according to the rules": it actually forward a '/' to the middleware if '%2f' appears in the URI. Encouraging me to remove all opportunities to get that '%2f' in the URI as part of a string variable,what I did.
Nevertheless, werkzeug own server does not unquote the URI before forwarding it to the middleware, and I still think that to keep the behavior consistent inside werkzeug, and get an idempotent operation, either my patch should be applied, or the server should unquote the '%2f'.
from werkzeug.
Related Issues (20)
- `pyright` in strict mode errors when using `formparser.MultiPartParser.parse`
- MultiDict does not handle None values HOT 1
- Test regression with pytest-8.0.0: `tests/test_exceptions.py::test_response_body[RequestRedirect]` HOT 2
- Add "421 Misdirected Request" http exception
- Update runtime dependencies HOT 1
- Random "ssl.SSLEOFError: EOF occurred in violation of protocol" when handling HTTP 206 HOT 2
- OSError: [WinError 10038] An operation was attempted on something that is not a socket HOT 2
- `FileStorage.name` should be the filename HOT 2
- Use of Python 2 `print` statement in quickstart docs
- Handle AssertionError for fkask-socketio HOT 2
- BaseWSGIServer: throw exception on bind failure rather than calling sys.exit() HOT 4
- TLS connection not properly closed HOT 1
- Inaccurate Content-Range header in for partial content responses. HOT 1
- Test failures with pytest-xprocess-1.0.1 HOT 4
- Uploading a file of a specific size causes the server to hang up HOT 1
- bad arg-parse in python versions >= (3, 10) HOT 2
- XMPP: Post to PubSub HOT 5
- Several issues with CacheControl types HOT 1
- `TypeConversionDict.pop` could pop with type HOT 1
- Upgrade of Werkzeug from 2.2.3 to 2.3.0 resulting in api failure
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from werkzeug.