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
"""
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
with multiple proxies
@@ -14,5 +19,7 @@ class MultipleProxyMiddleware(MiddlewareMixin): # pylint: disable=too-few-publi
Rewrites the proxy headers so that forwarded server is
used if available.
"""
if 'HTTP_X_FORWARDED_SERVER' in request.META:
request.META['HTTP_X_FORWARDED_HOST'] = request.META['HTTP_X_FORWARDED_SERVER']
if "HTTP_X_FORWARDED_SERVER" in request.META:
request.META["HTTP_X_FORWARDED_HOST"] = request.META[
"HTTP_X_FORWARDED_SERVER"
]