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

Function format_h2_response_headers

mitmproxy/proxy/layers/http/_http2.py:390–403  ·  view source on GitHub ↗
(
    context: Context,
    event: ResponseHeaders,
)

Source from the content-addressed store, hash-verified

388
389
390def format_h2_response_headers(
391 context: Context,
392 event: ResponseHeaders,
393) -> CommandGenerator[list[tuple[bytes, bytes]]]:
394 headers = [
395 (b":status", b"%d" % event.response.status_code),
396 *event.response.headers.fields,
397 ]
398 if event.response.is_http2 or event.response.is_http3:
399 if context.options.normalize_outbound_headers:
400 yield from normalize_h2_headers(headers)
401 else:
402 headers = normalize_h1_headers(headers, False)
403 return headers
404
405
406class Http2Server(Http2Connection):

Callers 2

_handle_eventMethod · 0.85
_handle_eventMethod · 0.85

Calls 2

normalize_h2_headersFunction · 0.85
normalize_h1_headersFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…