1
0
Fork 0
mirror of https://github.com/Kozea/Radicale.git synced 2025-09-15 20:36:55 +00:00

Merge pull request #1303 from pbiering/MOVE-on-non-standard-server-ports

MOVE on non standard server ports
This commit is contained in:
Peter Bieringer 2024-03-01 07:31:35 +01:00 committed by GitHub
commit 9f1e243f00
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 0 deletions

View file

@ -32,6 +32,7 @@ def get_server_netloc(environ: types.WSGIEnviron, force_port: bool = False):
host = environ["HTTP_X_FORWARDED_HOST"]
proto = environ.get("HTTP_X_FORWARDED_PROTO") or "http"
port = "443" if proto == "https" else "80"
port = environ["HTTP_X_FORWARDED_PORT"] or port
else:
host = environ.get("HTTP_HOST") or environ["SERVER_NAME"]
proto = environ["wsgi.url_scheme"]