Skip to content

Commit

Permalink
Fix client info force
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Oct 30, 2024
1 parent b4cb25e commit c35d866
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions c2cwsgiutils/client_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit c35d866

Please sign in to comment.