MCPcopy Create free account
hub / github.com/mitmproxy/mitmproxy / parse_headers

Method parse_headers

mitmproxy/proxy/layers/http/_http3.py:290–303  ·  view source on GitHub ↗
(self, event: HeadersReceived)

Source from the content-addressed store, hash-verified

288 yield cmd
289
290 def parse_headers(self, event: HeadersReceived) -> RequestHeaders | ResponseHeaders:
291 # same as HTTP/2
292 status_code, headers = parse_h2_response_headers(event.headers)
293 response = http.Response(
294 http_version=b"HTTP/3",
295 status_code=status_code,
296 reason=b"",
297 headers=headers,
298 content=None,
299 trailers=None,
300 timestamp_start=time.time(),
301 timestamp_end=None,
302 )
303 return ResponseHeaders(event.stream_id, response, event.stream_ended)
304
305
306__all__ = [

Callers

nothing calls this directly

Calls 2

ResponseHeadersClass · 0.85

Tested by

no test coverage detected