Clean up with black

This commit is contained in:
Oliver Falk
2021-09-14 16:02:04 +02:00
parent 4cdb61724f
commit c04e5ad266

View File

@@ -1,9 +1,14 @@
# -*- coding: utf-8 -*-
""" """
Middleware classes Middleware classes
""" """
from django.utils.deprecation import MiddlewareMixin from django.utils.deprecation import MiddlewareMixin
class MultipleProxyMiddleware(MiddlewareMixin): # pylint: disable=too-few-public-methods
class MultipleProxyMiddleware(
MiddlewareMixin
): # pylint: disable=too-few-public-methods
""" """
Middleware to rewrite proxy headers for deployments Middleware to rewrite proxy headers for deployments
with multiple proxies with multiple proxies
@@ -14,5 +19,7 @@ class MultipleProxyMiddleware(MiddlewareMixin): # pylint: disable=too-few-publi
Rewrites the proxy headers so that forwarded server is Rewrites the proxy headers so that forwarded server is
used if available. used if available.
""" """
if 'HTTP_X_FORWARDED_SERVER' in request.META: if "HTTP_X_FORWARDED_SERVER" in request.META:
request.META['HTTP_X_FORWARDED_HOST'] = request.META['HTTP_X_FORWARDED_SERVER'] request.META["HTTP_X_FORWARDED_HOST"] = request.META[
"HTTP_X_FORWARDED_SERVER"
]