diff --git a/HISTORY.rst b/HISTORY.rst index 87c7465..c57871d 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -1,6 +1,13 @@ History ======= +Pending +------- + +* Fix URL parameter encoding - URL escaping like `%3A` will now be passed + correctly to your application + (`Issue #101 `__). + 2.4.0 (2019-11-15) ------------------ diff --git a/tests/test_apig_wsgi.py b/tests/test_apig_wsgi.py index f6b77e9..dd596ab 100644 --- a/tests/test_apig_wsgi.py +++ b/tests/test_apig_wsgi.py @@ -241,6 +241,22 @@ def test_querystring_one(simple_app): assert simple_app.environ["QUERY_STRING"] == "foo=bar" +def test_querystring_encoding_value(simple_app): + event = make_event(qs_params={"foo": "a%20bar"}) + + simple_app.handler(event, None) + + assert simple_app.environ["QUERY_STRING"] == "foo=a%20bar" + + +def test_querystring_encoding_key(simple_app): + event = make_event(qs_params={"a%20foo": "bar"}) + + simple_app.handler(event, None) + + assert simple_app.environ["QUERY_STRING"] == "a%20foo=bar" + + def test_plain_header(simple_app): event = make_event(headers={"Test-Header": "foobar"})