Use Secure proxy ssl header only if no https

This commit is contained in:
sabaimran
2024-04-29 15:33:21 +05:30
parent 408f4780ce
commit 5beedc9734

View File

@@ -48,6 +48,7 @@ else:
# Production Settings # Production Settings
SESSION_COOKIE_DOMAIN = KHOJ_DOMAIN SESSION_COOKIE_DOMAIN = KHOJ_DOMAIN
CSRF_COOKIE_DOMAIN = KHOJ_DOMAIN CSRF_COOKIE_DOMAIN = KHOJ_DOMAIN
if not is_env_var_true("KHOJ_NO_HTTPS"):
SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https") SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")
SESSION_COOKIE_SECURE = not is_env_var_true("KHOJ_NO_HTTPS") SESSION_COOKIE_SECURE = not is_env_var_true("KHOJ_NO_HTTPS")