mirror of
https://github.com/Dispatcharr/Dispatcharr.git
synced 2026-01-23 02:35:14 +00:00
Update views.py
I moved on to LXC install on PVE. The x-tvg-url defaults back to 9191 port whilst in reality the port is defined as :80, therefore this obviously brakes this functionality.
Check request.META.get("SERVER_PORT") before falling back to defaults. This should capture the actual server port from the request.
This commit is contained in:
parent
9d4fd63cde
commit
400c77f258
1 changed files with 7 additions and 2 deletions
|
|
@ -2645,12 +2645,17 @@ def get_host_and_port(request):
|
|||
if port:
|
||||
return host, port
|
||||
|
||||
# 4. Dev fallback: guess port
|
||||
# 4. Try SERVER_PORT from META
|
||||
port = request.META.get("SERVER_PORT")
|
||||
if port:
|
||||
return host, port
|
||||
|
||||
# 5. Dev fallback: guess port
|
||||
if os.environ.get("DISPATCHARR_ENV") == "dev" or host in ("localhost", "127.0.0.1"):
|
||||
guess = "5656"
|
||||
return host, guess
|
||||
|
||||
# 5. Fallback to scheme default
|
||||
# 6. Fallback to scheme default
|
||||
port = "443" if request.is_secure() else "9191"
|
||||
return host, port
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue