mirror of
https://git.linux-kernel.at/oliver/ivatar.git
synced 2025-11-15 12:38:03 +00:00
Clean up with black
This commit is contained in:
@@ -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"
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user