mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-22 15:37:45 +00:00
Py3: fix http2 bytes issue
This commit is contained in:
parent
26fe7dc87d
commit
0f1aa2b78e
@ -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
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user