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

Function normalize_h2_headers

mitmproxy/proxy/layers/http/_http2.py:355–361  ·  view source on GitHub ↗
(headers: list[tuple[bytes, bytes]])

Source from the content-addressed store, hash-verified

353
354
355def normalize_h2_headers(headers: list[tuple[bytes, bytes]]) -> CommandGenerator[None]:
356 for i in range(len(headers)):
357 if not headers[i][0].islower():
358 yield Log(
359 f"Lowercased {repr(headers[i][0]).lstrip('b')} header as uppercase is not allowed with HTTP/2."
360 )
361 headers[i] = (headers[i][0].lower(), headers[i][1])
362
363
364def format_h2_request_headers(

Callers 2

Calls 1

LogClass · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…