Skip to content
Snippets Groups Projects
Commit 7c97ed0d authored by Vermaat's avatar Vermaat
Browse files

Keep original remote address in reverse-proxied requests

Fixes #22
parent c64561f6
No related branches found
No related tags found
No related merge requests found
...@@ -41,6 +41,10 @@ class _ReverseProxied(object): ...@@ -41,6 +41,10 @@ class _ReverseProxied(object):
scheme = environ.get('HTTP_X_SCHEME', '') scheme = environ.get('HTTP_X_SCHEME', '')
if scheme: if scheme:
environ['wsgi.url_scheme'] = scheme environ['wsgi.url_scheme'] = scheme
remote_address = environ.get('HTTP_X_FORWARDED_FOR', '')
if remote_address:
environ['REMOTE_ADDR'] = remote_address
return self.app(environ, *args, **kwargs) return self.app(environ, *args, **kwargs)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment