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

#879 Add url decoding for query string #952

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,19 @@ def test_wsgi_path_info_unquoted(self):
}
request = create_wsgi_request(event, trailing_slash=True)
self.assertEqual("/path:1", request["PATH_INFO"])

def test_wsgi_query_string_unquoted(self):
event = {
"body": {},
"headers": {},
"pathParameters": {},
"path": "/path/path1",
"httpMethod": "GET",
"queryStringParameters": {"a": "A,B", "b": "C#D"},
"requestContext": {}
}
request = create_wsgi_request(event)
self.assertEqual(request["QUERY_STRING"], "a=A,B&b=C#D")

def test_wsgi_latin1(self):
event = {
Expand Down
1 change: 1 addition & 0 deletions zappa/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ def create_wsgi_request(
else:
query = event_info.get("queryStringParameters", {})
query_string = urlencode(query) if query else ""
query_string = urls.url_unquote(query_string)

if context_header_mappings:
for key, value in context_header_mappings.items():
Expand Down