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,7 +48,8 @@ else:
# Production Settings
SESSION_COOKIE_DOMAIN = KHOJ_DOMAIN
CSRF_COOKIE_DOMAIN = KHOJ_DOMAIN
SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")
if not is_env_var_true("KHOJ_NO_HTTPS"):
SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")
SESSION_COOKIE_SECURE = not is_env_var_true("KHOJ_NO_HTTPS")
CSRF_COOKIE_SECURE = not is_env_var_true("KHOJ_NO_HTTPS")