diff options
author | Maximilian Hils <git@maximilianhils.com> | 2016-09-21 20:36:26 -0700 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2016-09-21 20:36:26 -0700 |
commit | f1d519d7c4231513c868179abf0fbfbb9387e633 (patch) | |
tree | 00b84f3a616c1c2c6e3469c2fb2a0be4a9d5e265 | |
parent | 770936f1f9b56010011c2af7f5f854d88f1c1d4f (diff) | |
download | mitmproxy-f1d519d7c4231513c868179abf0fbfbb9387e633.tar.gz mitmproxy-f1d519d7c4231513c868179abf0fbfbb9387e633.tar.bz2 mitmproxy-f1d519d7c4231513c868179abf0fbfbb9387e633.zip |
fix pathod http2 response creation
-rw-r--r-- | pathod/language/http2.py | 2 | ||||
-rw-r--r-- | pathod/protocols/http2.py | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/pathod/language/http2.py b/pathod/language/http2.py index c0313baa..519ee699 100644 --- a/pathod/language/http2.py +++ b/pathod/language/http2.py @@ -189,7 +189,7 @@ class Response(_HTTP2Message): resp = http.Response( b'HTTP/2.0', - self.status_code.string(), + int(self.status_code.string()), b'', headers, body, diff --git a/pathod/protocols/http2.py b/pathod/protocols/http2.py index a2aa91b4..7b162664 100644 --- a/pathod/protocols/http2.py +++ b/pathod/protocols/http2.py @@ -6,7 +6,7 @@ import time import hyperframe.frame from hpack.hpack import Encoder, Decoder -from netlib import utils, strutils +from netlib import utils from netlib.http import http2 import netlib.http.headers import netlib.http.response @@ -201,7 +201,7 @@ class HTTP2StateProtocol(object): headers = response.headers.copy() if ':status' not in headers: - headers.insert(0, b':status', strutils.always_bytes(response.status_code)) + headers.insert(0, b':status', str(response.status_code).encode()) if hasattr(response, 'stream_id'): stream_id = response.stream_id |