Skip to content

Commit

Permalink
Use Secure proxy ssl header only if no https
Browse files Browse the repository at this point in the history
  • Loading branch information
sabaimran committed Apr 29, 2024
1 parent 408f478 commit 5beedc9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/khoj/app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
# 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")
Expand Down

0 comments on commit 5beedc9

Please sign in to comment.