aboutsummaryrefslogtreecommitdiffstats
path: root/pathod/protocols
diff options
context:
space:
mode:
authorThomas Kriechbaumer <thomas@kriechbaumer.name>2016-07-03 19:04:16 +0200
committerThomas Kriechbaumer <thomas@kriechbaumer.name>2016-07-03 23:22:04 +0200
commit23e295b37eb3aee9ebe7c88cc1ebb1dc2ffa9cf2 (patch)
tree3d8876500f6c0ae57ecb1905294138b6c56043b5 /pathod/protocols
parent45aa2174e235f542d75d0305e7fb498b9b0585f9 (diff)
downloadmitmproxy-23e295b37eb3aee9ebe7c88cc1ebb1dc2ffa9cf2.tar.gz
mitmproxy-23e295b37eb3aee9ebe7c88cc1ebb1dc2ffa9cf2.tar.bz2
mitmproxy-23e295b37eb3aee9ebe7c88cc1ebb1dc2ffa9cf2.zip
py3: fix bytes vs. str
Diffstat (limited to 'pathod/protocols')
-rw-r--r--pathod/protocols/http2.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/pathod/protocols/http2.py b/pathod/protocols/http2.py
index d94cd981..5ad120de 100644
--- a/pathod/protocols/http2.py
+++ b/pathod/protocols/http2.py
@@ -181,10 +181,10 @@ class HTTP2StateProtocol(object):
headers = request.headers.copy()
if ':authority' not in headers:
- headers.insert(0, b':authority', authority.encode('ascii'))
- headers.insert(0, b':scheme', request.scheme.encode('ascii'))
- headers.insert(0, b':path', request.path.encode('ascii'))
- headers.insert(0, b':method', request.method.encode('ascii'))
+ headers.insert(0, ':authority', authority)
+ headers.insert(0, ':scheme', request.scheme)
+ headers.insert(0, ':path', request.path)
+ headers.insert(0, ':method', request.method)
if hasattr(request, 'stream_id'):
stream_id = request.stream_id
@@ -397,7 +397,7 @@ class HTTP2StateProtocol(object):
self._handle_unexpected_frame(frm)
headers = netlib.http.headers.Headers(
- (k.encode('ascii'), v.encode('ascii')) for k, v in self.decoder.decode(header_blocks)
+ [[k, v] for k, v in self.decoder.decode(header_blocks, raw=True)]
)
return stream_id, headers, body