mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-26 18:18:25 +00:00
fix pathod http2 response creation
This commit is contained in:
parent
770936f1f9
commit
f1d519d7c4
@ -189,7 +189,7 @@ class Response(_HTTP2Message):
|
|||||||
|
|
||||||
resp = http.Response(
|
resp = http.Response(
|
||||||
b'HTTP/2.0',
|
b'HTTP/2.0',
|
||||||
self.status_code.string(),
|
int(self.status_code.string()),
|
||||||
b'',
|
b'',
|
||||||
headers,
|
headers,
|
||||||
body,
|
body,
|
||||||
|
@ -6,7 +6,7 @@ import time
|
|||||||
import hyperframe.frame
|
import hyperframe.frame
|
||||||
from hpack.hpack import Encoder, Decoder
|
from hpack.hpack import Encoder, Decoder
|
||||||
|
|
||||||
from netlib import utils, strutils
|
from netlib import utils
|
||||||
from netlib.http import http2
|
from netlib.http import http2
|
||||||
import netlib.http.headers
|
import netlib.http.headers
|
||||||
import netlib.http.response
|
import netlib.http.response
|
||||||
@ -201,7 +201,7 @@ class HTTP2StateProtocol(object):
|
|||||||
headers = response.headers.copy()
|
headers = response.headers.copy()
|
||||||
|
|
||||||
if ':status' not in headers:
|
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'):
|
if hasattr(response, 'stream_id'):
|
||||||
stream_id = response.stream_id
|
stream_id = response.stream_id
|
||||||
|
Loading…
Reference in New Issue
Block a user