diff options
author | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2016-05-11 16:06:11 -0500 |
---|---|---|
committer | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2016-05-11 16:47:58 -0500 |
commit | 7a813936c629213ca56b6520f67254bb70f26184 (patch) | |
tree | 8a90c570b3587fbfb18c68f87f385fec23af38f5 /test | |
parent | bbf7b6f690fd61af5900df924b833140dc21daee (diff) | |
download | mitmproxy-7a813936c629213ca56b6520f67254bb70f26184.tar.gz mitmproxy-7a813936c629213ca56b6520f67254bb70f26184.tar.bz2 mitmproxy-7a813936c629213ca56b6520f67254bb70f26184.zip |
disable http2 header encoding, use bytes everywhere
Diffstat (limited to 'test')
-rw-r--r-- | test/mitmproxy/test_protocol_http2.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/test/mitmproxy/test_protocol_http2.py b/test/mitmproxy/test_protocol_http2.py index 1da140d8..ceb9bbb2 100644 --- a/test/mitmproxy/test_protocol_http2.py +++ b/test/mitmproxy/test_protocol_http2.py @@ -1,3 +1,5 @@ +# coding=utf-8 + from __future__ import (absolute_import, print_function, division) import OpenSSL @@ -36,7 +38,7 @@ class _Http2ServerBase(netlib_tservers.ServerTestBase): class handler(netlib.tcp.BaseHandler): def handle(self): - h2_conn = h2.connection.H2Connection(client_side=False) + h2_conn = h2.connection.H2Connection(client_side=False, header_encoding=False) preamble = self.rfile.read(24) h2_conn.initiate_connection() @@ -122,7 +124,7 @@ class _Http2TestBase(object): client.convert_to_ssl(alpn_protos=[b'h2']) - h2_conn = h2.connection.H2Connection(client_side=True) + h2_conn = h2.connection.H2Connection(client_side=True, header_encoding=False) h2_conn.initiate_connection() client.wfile.write(h2_conn.data_to_send()) client.wfile.flush() @@ -163,6 +165,7 @@ class TestSimple(_Http2TestBase, _Http2ServerBase): h2_conn.send_headers(1, [ (':status', '200'), ('foo', 'bar'), + ('föo', 'bär'), ]) h2_conn.send_data(1, b'foobar') h2_conn.end_stream(1) @@ -201,6 +204,7 @@ class TestSimple(_Http2TestBase, _Http2ServerBase): assert len(self.master.state.flows) == 1 assert self.master.state.flows[0].response.status_code == 200 assert self.master.state.flows[0].response.headers['foo'] == 'bar' + assert self.master.state.flows[0].response.headers['föo'] == 'bär' assert self.master.state.flows[0].response.body == b'foobar' |