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: prevent PREFERRED_URL_SCHEME from affecting test requests

LearningCircuit2198d6b43ff5
diff --git a/src/local_deep_research/web/app_factory.py b/src/local_deep_research/web/app_factory.py
index 0715656928..b9d4aba9ff 100644
--- a/src/local_deep_research/web/app_factory.py
+++ b/src/local_deep_research/web/app_factory.py
@@ -1,4 +1,5 @@
# import logging - replaced with loguru
+import os
from pathlib import Path
from importlib import resources as importlib_resources
@@ -93,7 +94,11 @@ def create_app():
app.config["SESSION_COOKIE_HTTPONLY"] = True
app.config["SESSION_COOKIE_SAMESITE"] = "Lax"
app.config["PERMANENT_SESSION_LIFETIME"] = 7200 # 2 hours in seconds
- app.config["PREFERRED_URL_SCHEME"] = "https"
+ # Only set PREFERRED_URL_SCHEME in production, not in testing
+ # This prevents test requests from incorrectly appearing as HTTPS
+ # Check both TESTING config and environment variable (set by pytest)
+ if not (app.config.get("TESTING", False) or os.environ.get("TESTING")):
+ app.config["PREFERRED_URL_SCHEME"] = "https"
# File upload security limits - calculated from FileUploadValidator constants
app.config["MAX_CONTENT_LENGTH"] = (