aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorThomas Kriechbaumer <Kriechi@users.noreply.github.com>2016-05-11 23:19:12 -0500
committerThomas Kriechbaumer <Kriechi@users.noreply.github.com>2016-05-11 23:19:12 -0500
commit518cc78454f9656be37e3153e2b508e56aa7ebf7 (patch)
tree4b70e799d3265c62da8c1f28ef9c771ea16480d7 /test
parentb174fd5e1fe3a6eddec449f58a0db793820fa3a3 (diff)
parent7a813936c629213ca56b6520f67254bb70f26184 (diff)
downloadmitmproxy-518cc78454f9656be37e3153e2b508e56aa7ebf7.tar.gz
mitmproxy-518cc78454f9656be37e3153e2b508e56aa7ebf7.tar.bz2
mitmproxy-518cc78454f9656be37e3153e2b508e56aa7ebf7.zip
Merge pull request #1137 from Kriechi/h2-header-encoding
disable http2 header encoding, use bytes everywhere
Diffstat (limited to 'test')
-rw-r--r--test/mitmproxy/test_protocol_http2.py8
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'