MCPcopy
hub / github.com/mitmproxy/mitmproxy / _native

Function _native

mitmproxy/http.py:40–41  ·  view source on GitHub ↗
(x: bytes)

Source from the content-addressed store, hash-verified

38
39# While headers _should_ be ASCII, it's not uncommon for certain headers to be utf-8 encoded.
40def _native(x: bytes) -> str:
41 return x.decode("utf-8", "surrogateescape")
42
43
44def _always_bytes(x: str | bytes) -> bytes:

Callers 3

__iter__Method · 0.85
get_allMethod · 0.85
itemsMethod · 0.85

Calls 1

decodeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…