diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2016-05-21 10:15:37 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2016-05-21 10:15:37 +1200 |
commit | 96d8ec1ee33b076a472afc3053fdd8256559fcc3 (patch) | |
tree | 933549b94c497b70eb6165f90bef191eebca4cc7 /netlib/http/http2/connections.py | |
parent | 84144ca0c635f4a42c8ba8a13e779fe127a81d45 (diff) | |
parent | b538138ead1dc8550f2d4e4a3f30ff70abb95f53 (diff) | |
download | mitmproxy-96d8ec1ee33b076a472afc3053fdd8256559fcc3.tar.gz mitmproxy-96d8ec1ee33b076a472afc3053fdd8256559fcc3.tar.bz2 mitmproxy-96d8ec1ee33b076a472afc3053fdd8256559fcc3.zip |
Merge branch 'multidict' of https://github.com/mhils/mitmproxy into mhils-multidict
Diffstat (limited to 'netlib/http/http2/connections.py')
-rw-r--r-- | netlib/http/http2/connections.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/netlib/http/http2/connections.py b/netlib/http/http2/connections.py index f900b67c..6643b6b9 100644 --- a/netlib/http/http2/connections.py +++ b/netlib/http/http2/connections.py @@ -201,13 +201,13 @@ class HTTP2Protocol(object): headers = request.headers.copy() if ':authority' not in headers: - headers.fields.insert(0, (b':authority', authority.encode('ascii'))) + headers.insert(0, b':authority', authority.encode('ascii')) if ':scheme' not in headers: - headers.fields.insert(0, (b':scheme', request.scheme.encode('ascii'))) + headers.insert(0, b':scheme', request.scheme.encode('ascii')) if ':path' not in headers: - headers.fields.insert(0, (b':path', request.path.encode('ascii'))) + headers.insert(0, b':path', request.path.encode('ascii')) if ':method' not in headers: - headers.fields.insert(0, (b':method', request.method.encode('ascii'))) + headers.insert(0, b':method', request.method.encode('ascii')) if hasattr(request, 'stream_id'): stream_id = request.stream_id @@ -224,7 +224,7 @@ class HTTP2Protocol(object): headers = response.headers.copy() if ':status' not in headers: - headers.fields.insert(0, (b':status', str(response.status_code).encode('ascii'))) + headers.insert(0, b':status', str(response.status_code).encode('ascii')) if hasattr(response, 'stream_id'): stream_id = response.stream_id @@ -420,7 +420,7 @@ class HTTP2Protocol(object): self._handle_unexpected_frame(frm) headers = Headers( - [[k.encode('ascii'), v.encode('ascii')] for k, v in self.decoder.decode(header_blocks)] + (k.encode('ascii'), v.encode('ascii')) for k, v in self.decoder.decode(header_blocks) ) return stream_id, headers, body |