aboutsummaryrefslogtreecommitdiffstats
path: root/test/netlib/http/http2
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2016-05-31 14:34:09 +1200
committerAldo Cortesi <aldo@nullcube.com>2016-05-31 14:36:17 +1200
commit9ea68ebd284ce13d765519a20dd7cfe998c0ae1c (patch)
tree635b4ef4be9203b61f932efb166ccda4bd03a140 /test/netlib/http/http2
parentd98582664d8f234fe6a2c805f02d47686243379f (diff)
downloadmitmproxy-9ea68ebd284ce13d765519a20dd7cfe998c0ae1c.tar.gz
mitmproxy-9ea68ebd284ce13d765519a20dd7cfe998c0ae1c.tar.bz2
mitmproxy-9ea68ebd284ce13d765519a20dd7cfe998c0ae1c.zip
Improve handling of pseudo-headers
- The canonical source for :method, :scheme and :path are the .method, .scheme and .path attributes on the request object. - These pseudo-headers are stripped after reading the request, and re-inserted just before sending. - The :authority header remains, and should be handled analagously to the Host header in HTTP1 with respect to display and user interaction.
Diffstat (limited to 'test/netlib/http/http2')
-rw-r--r--test/netlib/http/http2/test_connections.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/netlib/http/http2/test_connections.py b/test/netlib/http/http2/test_connections.py
index ff462ba6..69667d1c 100644
--- a/test/netlib/http/http2/test_connections.py
+++ b/test/netlib/http/http2/test_connections.py
@@ -312,7 +312,10 @@ class TestReadRequest(tservers.ServerTestBase):
req = protocol.read_request(NotImplemented)
assert req.stream_id
- assert req.headers.fields == ((b':method', b'GET'), (b':path', b'/'), (b':scheme', b'https'))
+ assert req.headers.fields == ()
+ assert req.method == "GET"
+ assert req.path == "/"
+ assert req.scheme == "https"
assert req.content == b'foobar'