Skip to content
Myr

fix resolve redirect to pass all original arguments

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

authored by Paul van der Linden · committed by Paul van der Linden · parent 86f9b16 · Browse files · 2 files+5 added−12 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+5 added−12 removed

  • other:+5 added−12 removed

2 files+5 added−12 removed

modified:requests/sessions.py+3 added-11 removed
88 unmodified lines
899091class SessionRedirectMixin(object):92 def resolve_redirects(self, resp, req, stream=False, timeout=None,93 verify=True, cert=None, proxies=None):93 verify=True, cert=None, proxies=None, **adapter_kwargs):94 """Receives a Response. Returns a generator of Responses."""9596 i = 097 hist = [] # keep track of history
94 unmodified lines
192 verify=verify,193 cert=cert,194 proxies=proxies,195 allow_redirects=False,196 **adapter_kwargs197 )198199 extract_cookies_to_jar(self.cookies, prepared_request, resp.raw)200
359 unmodified lines
560561 # Set up variables needed for resolve_redirects and dispatching of hooks562 allow_redirects = kwargs.pop('allow_redirects', True)563 stream = kwargs.get('stream')563 timeout = kwargs.get('timeout')564 verify = kwargs.get('verify')565 cert = kwargs.get('cert')566 proxies = kwargs.get('proxies')564 hooks = request.hooks565566 # Get the appropriate adapter to use567 adapter = self.get_adapter(url=request.url)
19 unmodified lines
587588 extract_cookies_to_jar(self.cookies, request, r.raw)589590 # Redirect resolving generator.594 gen = self.resolve_redirects(r, request,595 stream=stream,596 timeout=timeout,597 verify=verify,598 cert=cert,599 proxies=proxies)591 gen = self.resolve_redirects(r, request, **kwargs)592593 # Resolve redirects if allowed.594 history = [resp for resp in gen] if allow_redirects else []595
82 unmodified lines
modified:AUTHORS.rst+2 added-1 removed
158 unmodified lines
159- Syed Suhail Ahmed <ssuhail.ahmed93@gmail.com> (`@syedsuhail <https://github.com/syedsuhail>`_)160- Scott Sadler (`@ssadler <https://github.com/ssadler>`_)161- Arthur Darcet (`@arthurdarcet <https://github.com/arthurdarcet>`_)162- Ulrich Petri (`@ulope <https://github.com/ulope>`_)163- Muhammad Yasoob Ullah Khalid <yasoob.khld@gmail.com> (`@yasoob <https://github.com/yasoob>`_)163- Muhammad Yasoob Ullah Khalid <yasoob.khld@gmail.com> (`@yasoob <https://github.com/yasoob>`_)164- Paul van der Linden (`@pvanderlinden <https://github.com/pvanderlinden>`_)