dashboard/helpers/classes.py
Mart van Santen e8063b1de7 Create /web router for login panel parts
Integrated helper classes and configuration
Create login "area"
2022-03-21 15:02:29 +08:00

17 lines
No EOL
684 B
Python

"""Generic classes used by different parts of the application"""
import urllib.request
# Instead of processing the redirect, we return, so the application
# can handle the redirect itself. This is needed to extract cookies
# etc.
class RedirectFilter(urllib.request.HTTPRedirectHandler):
"""Overrides the standard redirect handler so it does not automatically
redirect. This allows for inspecting the return values before redirecting or
override the redirect action"""
# pylint: disable=too-many-arguments
# This amount of arguments is expected by the HTTPRedirectHandler
def redirect_request(self, req, fp, code, msg, headers, newurl):
return None