MCPcopy Index your code
hub / github.com/mitmproxy/mitmproxy / get_all

Method get_all

mitmproxy/http.py:145–156  ·  view source on GitHub ↗

Like `Headers.get`, but does not fold multiple headers into a single one. This is useful for Set-Cookie and Cookie headers, which do not support folding. *See also:* - - <https://datatracker.ietf.org/doc/

(self, name: str | bytes)

Source from the content-addressed store, hash-verified

143 yield _native(x)
144
145 def get_all(self, name: str | bytes) -> list[str]:
146 """
147 Like `Headers.get`, but does not fold multiple headers into a single one.
148 This is useful for Set-Cookie and Cookie headers, which do not support folding.
149
150 *See also:*
151 - <https://tools.ietf.org/html/rfc7230#section-3.2.2>
152 - <https://datatracker.ietf.org/doc/html/rfc6265#section-5.4>
153 - <https://datatracker.ietf.org/doc/html/rfc7540#section-8.1.2.5>
154 """
155 name = _always_bytes(name)
156 return [_native(x) for x in super().get_all(name)]
157
158 def set_all(self, name: str | bytes, values: Iterable[str | bytes]):
159 """

Callers 7

test_get_allMethod · 0.45
test_modify_headersMethod · 0.45
_get_cookiesMethod · 0.45
_get_cookiesMethod · 0.45
refreshMethod · 0.45
responseFunction · 0.45
responseFunction · 0.45

Calls 2

_always_bytesFunction · 0.85
_nativeFunction · 0.85

Tested by 2

test_get_allMethod · 0.36
test_modify_headersMethod · 0.36