Skip to content
Myr

Merge pull request #1030 from bboe/cookie_fix

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

Fix issue 1027. Always persist cookies.

authored by Kenneth Reitz · committed by Kenneth Reitz · parents a2f773a, e355d6a · Browse files · 1 file+4 added−4 removed
This commit

State

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

Diff stats

1 file+4 added−4 removed

  • other:+4 added−4 removed

1 file+4 added−4 removed

modified:requests/sessions.py+4 added-4 removed
69 unmodified lines
7071 # ((resp.status_code is codes.see_other))72 while (('location' in resp.headers and resp.status_code in REDIRECT_STATI)):7374 # Persist cookies.75 for cookie in resp.cookies:76 self.cookies.set_cookie(cookie)7774 resp.content # Consume socket so it can be released7576 if i >= self.max_redirects:77 raise TooManyRedirects('Exceeded %s redirects.' % self.max_redirects)
182 unmodified lines
260261 # Send the request.262 resp = self.send(prep, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies)263264 # Persist cookies.265 for cookie in resp.cookies:266 self.cookies.set_cookie(cookie)267268 # Redirect resolving generator.269 gen = self.resolve_redirects(resp, req, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies)270271 # Resolve redirects if allowed.
114 unmodified lines