Skip to content
Myr

Move session cookie saving from Session.request() to Request._build_response()

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

authored by Roman Haritonov · committed by Roman Haritonov · parent 975430d · Browse files · 2 files+6 added−6 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+6 added−6 removed

  • other:+6 added−6 removed

2 files+6 added−6 removed

modified:requests/models.py+6 added
201 unmodified lines
202203 # Save cookies in Response.204 response.cookies = self.cookies205206 # Save cookies in Session.207 # (in safe mode, cookies may be None if the request didn't succeed)208 if self.cookies is not None:209 for cookie in self.cookies:210 self.session.cookies.set_cookie(cookie)211212 # No exceptions were harmed in the making of this request.213 response.error = getattr(resp, 'error', None)214215 # Save original response for later.
637 unmodified lines
modified:requests/sessions.py-6 removed
226 unmodified lines
227228 # Send the HTTP Request.229 r.send(prefetch=prefetch)230231 # Send any cookies back up the to the session.232 # (in safe mode, cookies may be None if the request didn't succeed)233 if r.response.cookies is not None:234 for cookie in r.response.cookies:235 self.cookies.set_cookie(cookie)236231 # Return the response.232 return r.response233234
89 unmodified lines