Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

fix: check WSGI url_scheme directly for HSTS header

LearningCircuitf8fe725160dc
diff --git a/src/local_deep_research/security/security_headers.py b/src/local_deep_research/security/security_headers.py
index 520fbc05ae..759079c8d1 100644
--- a/src/local_deep_research/security/security_headers.py
+++ b/src/local_deep_research/security/security_headers.py
@@ -171,8 +171,8 @@ class SecurityHeaders:
response.headers["Referrer-Policy"] = "strict-origin-when-cross-origin"
# HSTS - enforce HTTPS connections (only when using HTTPS)
- # Only set HSTS for actual HTTPS requests, not based on preferred scheme
- if request.is_secure:
+ # Check actual request scheme from WSGI environment, not Flask config
+ if request.environ.get("wsgi.url_scheme") == "https":
# max-age=31536000 is 1 year, includeSubDomains applies to all subdomains
response.headers["Strict-Transport-Security"] = (
"max-age=31536000; includeSubDomains"