Skip to content

Commit

Permalink
Improve URL encoding tests and add HISTORY note (#104)
Browse files Browse the repository at this point in the history
Improvements for #102.
  • Loading branch information
adamchainz authored Jan 13, 2020
1 parent 42d5510 commit a047b66
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
7 changes: 7 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
History
=======

Pending
-------

* Fix URL parameter encoding - URL escaping like `%3A` will now be passed
correctly to your application
(`Issue #101 <https://github.com/adamchainz/apig-wsgi/issues/101>`__).

2.4.0 (2019-11-15)
------------------

Expand Down
16 changes: 16 additions & 0 deletions tests/test_apig_wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"})

Expand Down

0 comments on commit a047b66

Please sign in to comment.