Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Allow configuring USE_X_FORWARDED_HOST

Roland Geider990770f8eaa3
diff --git a/settings/main.py b/settings/main.py
index 2fbf72344..9e2c36b12 100644
--- a/settings/main.py
+++ b/settings/main.py
@@ -301,6 +301,11 @@ if env.bool('X_FORWARDED_PROTO_HEADER_SET', False):
'https',
)
+# Build absolute URLs (e.g. OAuth redirect URIs) from the X-Forwarded-Host
+# header instead of the Host header. Only enable this behind a reverse proxy
+# that sets the header, as it is otherwise attacker-controlled.
+USE_X_FORWARDED_HOST = env.bool('USE_X_FORWARDED_HOST', False)
+
REST_FRAMEWORK['NUM_PROXIES'] = env.int('NUMBER_OF_PROXIES', 1)
#