Skip to content
Myr

clarified documentation from e-mail discussion

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Shivaram Lingamneni · committed by Shivaram Lingamneni · parent 1de14e6 · Browse files · 2 files+15 added−9 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+15 added−9 removed

  • other:+15 added−9 removed

2 files+15 added−9 removed

modified:requests/cookies.py+14 added-8 removed
85 unmodified lines
86 def getheaders(self, name):87 self._headers.getheaders(name)8889def extract_cookies_to_jar(jar, request, response):90 """Extract the cookies from the headers of `response`, into `jar`."""91 if response._original_response is None:92 # TODO why would this happen?93 return94 req = MockRequest(request)95 # pull out the HTTPMessage with the headers and put it in the mock:96 res = MockResponse(response._original_response.msg)97 jar.extract_cookies(res, req)90 """Extract the cookies from the response into a CookieJar.9192 :param jar: cookielib.CookieJar (not necessarily a RequestsCookieJar)93 :param request: our own requests.Request object94 :param response: urllib3.HTTPResponse object95 """96 # the _original_response field is the wrapped httplib.HTTPResponse object,97 # and in safe mode, it may be None if the request didn't actually complete.98 # in that case, just skip the cookie extraction.99 if response._original_response is not None:100 req = MockRequest(request)101 # pull out the HTTPMessage with the headers and put it in the mock:102 res = MockResponse(response._original_response.msg)103 jar.extract_cookies(res, req)104105def get_cookie_header(jar, request):106 """Produce an appropriate Cookie header string to be sent with `request`, or None."""107 r = MockRequest(request)108 jar.add_cookie_header(r)
156 unmodified lines
modified:AUTHORS.rst+1 added-1 removed
94 unmodified lines
95- Michael Kelly96- Michael Newman <newmaniese@gmail.com>97- Jonty Wareing <jonty@jonty.co.uk>98- Shivaram Lingamneni99- Miguel (dhagrow)99- Miguel Turner