From ce2d36dbabbcb0c5da8f5a3f5026b0a70c4c8543 Mon Sep 17 00:00:00 2001 From: Alexander Prinzhorn Date: Thu, 3 Jun 2021 03:11:40 +0200 Subject: [PATCH] Document Cookie header folding issues (#4618) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Document Cookie header folding issues * plural: *exists*, me: 😮 * link list --- mitmproxy/http.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/mitmproxy/http.py b/mitmproxy/http.py index b3060bd31..f5873b077 100644 --- a/mitmproxy/http.py +++ b/mitmproxy/http.py @@ -86,7 +86,7 @@ class Headers(multidict.MultiDict): # type: ignore >>> h.fields Caveats: - - For use with the "Set-Cookie" header, either use `Response.cookies` or see `Headers.get_all`. + - For use with the "Set-Cookie" and "Cookie" headers, either use `Response.cookies` or see `Headers.get_all`. """ def __init__(self, fields: Iterable[Tuple[bytes, bytes]] = (), **headers): @@ -142,9 +142,12 @@ class Headers(multidict.MultiDict): # type: ignore def get_all(self, name: Union[str, bytes]) -> List[str]: """ Like `Headers.get`, but does not fold multiple headers into a single one. - This is useful for Set-Cookie headers, which do not support folding. + This is useful for Set-Cookie and Cookie headers, which do not support folding. - *See also:* + *See also:* + - + - + - """ name = _always_bytes(name) return [