MCPcopy
hub / github.com/mitmproxy/mitmproxy / decode_frames

Function decode_frames

test/mitmproxy/proxy/layers/http/test_http2.py:58–68  ·  view source on GitHub ↗
(data: bytes)

Source from the content-addressed store, hash-verified

56
57
58def decode_frames(data: bytes) -> list[hyperframe.frame.Frame]:
59 # swallow preamble
60 if data.startswith(b"PRI * HTTP/2.0"):
61 data = data[24:]
62 frames = []
63 while data:
64 f, length = hyperframe.frame.Frame.parse_frame_header(data[:9])
65 f.parse_body(memoryview(data[9 : 9 + length]))
66 frames.append(f)
67 data = data[9 + length :]
68 return frames
69
70
71def start_h2_client(tctx: Context, keepalive: int = 0) -> tuple[Playbook, FrameFactory]:

Callers 12

test_simpleFunction · 0.85
test_request_trailersFunction · 0.85
test_upstream_errorFunction · 0.85
test_long_responseFunction · 0.85
test_no_normalizationFunction · 0.85
test_stream_concurrencyFunction · 0.85
test_max_concurrencyFunction · 0.85
test_kill_streamFunction · 0.85
test_early_server_dataFunction · 0.85

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…