From c35d8665bf36be043ce31cb2808d5b4178d0ae92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Wed, 30 Oct 2024 12:37:33 +0100 Subject: [PATCH] Fix client info force --- c2cwsgiutils/client_info.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/c2cwsgiutils/client_info.py b/c2cwsgiutils/client_info.py index 5332d760b..de8c0b014 100644 --- a/c2cwsgiutils/client_info.py +++ b/c2cwsgiutils/client_info.py @@ -26,13 +26,13 @@ def __call__(self, environ: dict[str, str], start_response: Any) -> Any: _handle_others(environ) if "C2CWSGIUTILS_FORCE_PROTO" in os.environ: - os.environ["wsgi.url_scheme"] = os.environ.pop("C2CWSGIUTILS_FORCE_PROTO") + environ["wsgi.url_scheme"] = os.environ["C2CWSGIUTILS_FORCE_PROTO"] if "C2CWSGIUTILS_FORCE_HOST" in os.environ: - os.environ["HTTP_HOST"] = os.environ.pop("C2CWSGIUTILS_FORCE_HOST") + environ["HTTP_HOST"] = os.environ["C2CWSGIUTILS_FORCE_HOST"] if "C2CWSGIUTILS_FORCE_SERVER_NAME" in os.environ: - os.environ["SERVER_NAME"] = os.environ.pop("C2CWSGIUTILS_FORCE_SERVER_NAME") + environ["SERVER_NAME"] = os.environ["C2CWSGIUTILS_FORCE_SERVER_NAME"] if "C2CWSGIUTILS_FORCE_REMOTE_ADDR" in os.environ: - os.environ["REMOTE_ADDR"] = os.environ.pop("C2CWSGIUTILS_FORCE_REMOTE_ADDR") + environ["REMOTE_ADDR"] = os.environ["C2CWSGIUTILS_FORCE_REMOTE_ADDR"] return self._application(environ, start_response)