From 9b466db5c9d1d717cfb136cacb741f59333445c3 Mon Sep 17 00:00:00 2001 From: Jack Fischer Date: Sat, 3 Dec 2016 15:19:24 -0500 Subject: [PATCH] test for http2 lowercase header cookies --- tests/test_cookies.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/test_cookies.py b/tests/test_cookies.py index 5b27c2e7..cf6a4259 100644 --- a/tests/test_cookies.py +++ b/tests/test_cookies.py @@ -25,6 +25,19 @@ def test_cookies(): assert response.text == 'Cookies are: working!' assert response_cookies['right_back'].value == 'at you' +def test_http2_cookies(): + app = Sanic('test_http2_cookies') + + @app.route('/') + async def handler(request): + response = text('Cookies are: {}'.format(request.cookies['test'])) + return response + + headers = {'cookie': 'test=working!'} + request, response = sanic_endpoint_test(app, headers=headers) + + assert response.text == 'Cookies are: working!' + def test_cookie_options(): app = Sanic('test_text')