mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-30 03:14:22 +00:00
fix pragmas
This commit is contained in:
parent
dd3067ab6e
commit
3fadda2bba
@ -520,7 +520,7 @@ class _Connection:
|
|||||||
def alpn_select_callback(conn_, options):
|
def alpn_select_callback(conn_, options):
|
||||||
if alpn_select in options:
|
if alpn_select in options:
|
||||||
return bytes(alpn_select)
|
return bytes(alpn_select)
|
||||||
else: # pragma no cover
|
else: # pragma: no cover
|
||||||
return options[0]
|
return options[0]
|
||||||
context.set_alpn_select_callback(alpn_select_callback)
|
context.set_alpn_select_callback(alpn_select_callback)
|
||||||
elif alpn_select_callback is not None and alpn_select is None:
|
elif alpn_select_callback is not None and alpn_select is None:
|
||||||
|
@ -247,13 +247,13 @@ class HTTP2StateProtocol:
|
|||||||
raw_bytes = frm.serialize()
|
raw_bytes = frm.serialize()
|
||||||
self.tcp_handler.wfile.write(raw_bytes)
|
self.tcp_handler.wfile.write(raw_bytes)
|
||||||
self.tcp_handler.wfile.flush()
|
self.tcp_handler.wfile.flush()
|
||||||
if not hide and self.dump_frames: # pragma no cover
|
if not hide and self.dump_frames: # pragma: no cover
|
||||||
print(">> " + repr(frm))
|
print(">> " + repr(frm))
|
||||||
|
|
||||||
def read_frame(self, hide=False):
|
def read_frame(self, hide=False):
|
||||||
while True:
|
while True:
|
||||||
frm = http2.parse_frame(*http2.read_raw_frame(self.tcp_handler.rfile))
|
frm = http2.parse_frame(*http2.read_raw_frame(self.tcp_handler.rfile))
|
||||||
if not hide and self.dump_frames: # pragma no cover
|
if not hide and self.dump_frames: # pragma: no cover
|
||||||
print("<< " + repr(frm))
|
print("<< " + repr(frm))
|
||||||
|
|
||||||
if isinstance(frm, hyperframe.frame.PingFrame):
|
if isinstance(frm, hyperframe.frame.PingFrame):
|
||||||
@ -337,7 +337,7 @@ class HTTP2StateProtocol:
|
|||||||
if end_stream:
|
if end_stream:
|
||||||
frms[0].flags.add('END_STREAM')
|
frms[0].flags.add('END_STREAM')
|
||||||
|
|
||||||
if self.dump_frames: # pragma no cover
|
if self.dump_frames: # pragma: no cover
|
||||||
for frm in frms:
|
for frm in frms:
|
||||||
print(">> ", repr(frm))
|
print(">> ", repr(frm))
|
||||||
|
|
||||||
@ -355,7 +355,7 @@ class HTTP2StateProtocol:
|
|||||||
data=body[i:i + chunk_size]) for i in chunks]
|
data=body[i:i + chunk_size]) for i in chunks]
|
||||||
frms[-1].flags.add('END_STREAM')
|
frms[-1].flags.add('END_STREAM')
|
||||||
|
|
||||||
if self.dump_frames: # pragma no cover
|
if self.dump_frames: # pragma: no cover
|
||||||
for frm in frms:
|
for frm in frms:
|
||||||
print(">> ", repr(frm))
|
print(">> ", repr(frm))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user