MCPcopy
hub / github.com/encode/httpx / _obfuscate_sensitive_headers

Function _obfuscate_sensitive_headers

httpx/_models.py:130–136  ·  view source on GitHub ↗
(
    items: typing.Iterable[tuple[typing.AnyStr, typing.AnyStr]],
)

Source from the content-addressed store, hash-verified

128
129
130def _obfuscate_sensitive_headers(
131 items: typing.Iterable[tuple[typing.AnyStr, typing.AnyStr]],
132) -> typing.Iterator[tuple[typing.AnyStr, typing.AnyStr]]:
133 for k, v in items:
134 if to_str(k.lower()) in SENSITIVE_HEADERS:
135 v = to_bytes_or_str("[secure]", match_type_of=v)
136 yield k, v
137
138
139class Headers(typing.MutableMapping[str, str]):

Callers 1

__repr__Method · 0.85

Calls 2

to_strFunction · 0.85
to_bytes_or_strFunction · 0.85

Tested by

no test coverage detected