Skip to content
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

REQUEST_URI should preserve the query string #1781

Closed
fmang opened this issue Mar 30, 2020 · 3 comments · Fixed by #1853
Closed

REQUEST_URI should preserve the query string #1781

fmang opened this issue Mar 30, 2020 · 3 comments · Fixed by #1853
Milestone

Comments

@fmang
Copy link
Contributor

fmang commented Mar 30, 2020

REQUEST_URI was introduced by #1419: 7162f43

Currently, Werkzeug strips the query string. While REQUEST_URI is not a standard variable, I believe the consensus is to include the query string. According to #766 (comment) that should have be the case for Werkzeug too.

That applies to RAW_URI too.

It’s an edge case, but ideally empty query strings like in /? should be preserved too and not simplified to /.

@davidism
Copy link
Member

I can't reproduce this issue. I ran the following example and got the full unquoted path and query.

from pprint import pformat
from werkzeug import Request, Response, run_simple

@Request.application
def app(request):
    return Response(pformat(request.environ))

if __name__ == "__main__":
    run_simple("localhost", 5000, app)

Navigating to http://localhost:5000/a%2fb?a=%2f, REQUEST_URI was /a%2fb?a=%2f.

@davidism
Copy link
Member

#1782 shows that this is about the test client, not the dev server.

@kx-chen
Copy link
Contributor

kx-chen commented Jun 18, 2020

Working on this.

kx-chen added a commit to MLH-Fellowship/werkzeug that referenced this issue Jun 18, 2020
kx-chen added a commit to MLH-Fellowship/werkzeug that referenced this issue Jun 18, 2020
kx-chen added a commit to MLH-Fellowship/werkzeug that referenced this issue Jun 18, 2020
kx-chen added a commit to MLH-Fellowship/werkzeug that referenced this issue Jun 18, 2020
kx-chen added a commit to MLH-Fellowship/werkzeug that referenced this issue Jun 18, 2020
@davidism davidism added this to the 2.0.0 milestone Jun 19, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants