aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShadab Zafar <dufferzafar0@gmail.com>2016-06-13 13:02:13 +0530
committerThomas Kriechbaumer <thomas@kriechbaumer.name>2016-06-15 09:49:38 +0200
commit0f1aa2b78e1c22da16a482aedae4ed9800830007 (patch)
tree93c577f2a3e4f281bd0489ce6732c12f3af75e52
parent26fe7dc87d83acca8541a618f105e6d5532cf55f (diff)
downloadmitmproxy-0f1aa2b78e1c22da16a482aedae4ed9800830007.tar.gz
mitmproxy-0f1aa2b78e1c22da16a482aedae4ed9800830007.tar.bz2
mitmproxy-0f1aa2b78e1c22da16a482aedae4ed9800830007.zip
Py3: fix http2 bytes issue
-rw-r--r--netlib/http/http2/connections.py4
-rw-r--r--pathod/language/http2.py2
2 files changed, 3 insertions, 3 deletions
diff --git a/netlib/http/http2/connections.py b/netlib/http/http2/connections.py
index 8667d370..8f246feb 100644
--- a/netlib/http/http2/connections.py
+++ b/netlib/http/http2/connections.py
@@ -5,7 +5,7 @@ import time
import hyperframe.frame
from hpack.hpack import Encoder, Decoder
-from netlib import utils
+from netlib import utils, strutils
from netlib.http import url
import netlib.http.headers
import netlib.http.response
@@ -230,7 +230,7 @@ class HTTP2Protocol(object):
headers = response.headers.copy()
if ':status' not in headers:
- headers.insert(0, b':status', str(response.status_code).encode('ascii'))
+ headers.insert(0, b':status', strutils.always_bytes(response.status_code))
if hasattr(response, 'stream_id'):
stream_id = response.stream_id
diff --git a/pathod/language/http2.py b/pathod/language/http2.py
index ea4fcd27..2693446e 100644
--- a/pathod/language/http2.py
+++ b/pathod/language/http2.py
@@ -188,7 +188,7 @@ class Response(_HTTP2Message):
body = body.string()
resp = http.Response(
- (2, 0),
+ b'HTTP/2.0',
self.status_code.string(),
b'',
headers,