Skip to content
Myr

Preserve the original request.

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

Let's make a copy to preserve it.

authored by Ian Cordasco · committed by Ian Cordasco · parent e2ad0d0 · Browse files · 1 file+9 added−3 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+9 added−3 removed

  • other:+9 added−3 removed

1 file+9 added−3 removed

modified:requests/sessions.py+9 added-3 removed
11 unmodified lines
12from datetime import datetime1314from .compat import cookielib15from .cookies import cookiejar_from_dict16from .models import Request16from .models import Request, PreparedRequest17from .hooks import default_hooks, dispatch_hook18from .utils import from_key_val_list, default_headers19from .exceptions import TooManyRedirects, InvalidSchema20
52 unmodified lines
73 return kwargs747576class SessionRedirectMixin(object):77 def resolve_redirects(self, resp, prepared_request, stream=False,78 timeout=None, verify=True, cert=None, proxies=None):77 def resolve_redirects(self, resp, req, stream=False, timeout=None,78 verify=True, cert=None, proxies=None):79 """Receives a Response. Returns a generator of Responses."""8081 i = 082 prepared_request = PreparedRequest()83 prepared_request.body = req.body84 prepared_request.headers = req.headers.copy()85 prepared_request.hooks = req.hooks86 prepared_request.method = req.method87 prepared_request.url = req.url8889 # ((resp.status_code is codes.see_other))90 while (('location' in resp.headers and resp.status_code in REDIRECT_STATI)):91
363 unmodified lines