Skip to content

Commit

Permalink
✨ (#879) Fix url decoding for query string
Browse files Browse the repository at this point in the history
  • Loading branch information
monkut committed Aug 12, 2022
1 parent 5869e47 commit 62a53ed
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -2732,6 +2732,19 @@ def test_unsupported_version_error(self, *_):

reload(zappa)

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")


if __name__ == "__main__":
unittest.main()
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

0 comments on commit 62a53ed

Please sign in to comment.