OpenQuizz
Une application de gestion des contenus pédagogiques
SessionRedirectMixin Class Reference
Inheritance diagram for SessionRedirectMixin:
Collaboration diagram for SessionRedirectMixin:

Public Member Functions

def get_redirect_target (self, resp)
 
def should_strip_auth (self, old_url, new_url)
 
def resolve_redirects (self, resp, req, stream=False, timeout=None, verify=True, cert=None, proxies=None, yield_requests=False, **adapter_kwargs)
 
def rebuild_auth (self, prepared_request, response)
 
def rebuild_proxies (self, prepared_request, proxies)
 
def rebuild_method (self, prepared_request, response)
 

Member Function Documentation

◆ get_redirect_target()

def get_redirect_target (   self,
  resp 
)
Receives a Response. Returns a redirect URI or ``None``

◆ rebuild_auth()

def rebuild_auth (   self,
  prepared_request,
  response 
)
When being redirected we may want to strip authentication from the
request to avoid leaking credentials. This method intelligently removes
and reapplies authentication where possible to avoid credential loss.

◆ rebuild_method()

def rebuild_method (   self,
  prepared_request,
  response 
)
When being redirected we may want to change the method of the request
based on certain specs or browser behavior.

◆ rebuild_proxies()

def rebuild_proxies (   self,
  prepared_request,
  proxies 
)
This method re-evaluates the proxy configuration by considering the
environment variables. If we are redirected to a URL covered by
NO_PROXY, we strip the proxy configuration. Otherwise, we set missing
proxy keys for this URL (in case they were stripped by a previous
redirect).

This method also replaces the Proxy-Authorization header where
necessary.

:rtype: dict

◆ resolve_redirects()

def resolve_redirects (   self,
  resp,
  req,
  stream = False,
  timeout = None,
  verify = True,
  cert = None,
  proxies = None,
  yield_requests = False,
**  adapter_kwargs 
)
Receives a Response. Returns a generator of Responses or Requests.

◆ should_strip_auth()

def should_strip_auth (   self,
  old_url,
  new_url 
)
Decide whether Authorization header should be removed when redirecting

The documentation for this class was generated from the following file: