-
Notifications
You must be signed in to change notification settings - Fork 691
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unquote path before injecting into environment #1263
Comments
This can be seen pretty clearly in https://www.python.org/dev/peps/pep-3333/#url-reconstruction, which shows the re-quoting of PATH_INFO when trying to construct the original URL. |
The PATH_INFO is managed here: https://github.com/unbit/uwsgi/blob/master/proto/http.c#L217 I am pretty sure nginx passes the right PATH_INFO |
I'm pretty sure I'm working in http mode (with uwsgi 2.0.11.2, for what it's worth), and not getting the path decode. Concretely, here's my config:
And if I make a request such as: I end up with a foo%40blah.com permission, instead of [email protected]. (Apologies if this is turning into a support request...) |
Can you try with a simpler config without the rewrite rule ?
uwsgi --http :8080 --wsgi-file foo.py Returns the expected output Maybe the rewrite plugin is broken ? |
Indeed - if I remove all of the routing options, the path is unquoted as expected. If I just add the rewrite back, unquoting fails to happen. |
…gi environment, per wsgi spec (fixes #1263)
While migrating an application from mod_wsgi -> uwsgi I discovered that some of my routes were not working -- specifically those that can contain quoted characters like @ or :
I did some digging on this, and according to this gunicorn thread, PATH_INFO is required to be unquoted: benoitc/gunicorn#1211 (comment).
AFAICT, uwsgi does not unquote paths by default nor is there a way to enable it (short of manually writing some route processing hacks). If that thread is correct, uwsgi should be doing this. It's also possible I've misunderstood the contract between the wsgi server and the app.
The text was updated successfully, but these errors were encountered: