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: use request.host_url for internal API calls

LearningCircuit0ed474d7b527
diff --git a/src/local_deep_research/news/flask_api.py b/src/local_deep_research/news/flask_api.py
index e29c35f85c..6982eb262d 100644
--- a/src/local_deep_research/news/flask_api.py
+++ b/src/local_deep_research/news/flask_api.py
@@ -557,15 +557,15 @@ def run_subscription_now(subscription_id: str) -> Dict[str, Any]:
request_data["custom_endpoint"] = subscription["custom_endpoint"]
# Call the main research API endpoint (use the one from research blueprint)
- # Use localhost for internal self-call (server is always reachable at 127.0.0.1)
- settings_manager = get_settings_manager()
- port = settings_manager.get_setting("web.port", 5000)
+ # Use request.host_url to get the actual URL the server is responding on
+ base_url = request.host_url.rstrip("/")
response = safe_post(
- f"http://127.0.0.1:{port}/research/api/start_research",
+ f"{base_url}/research/api/start_research",
json=request_data,
headers={"Content-Type": "application/json"},
allow_localhost=True,
+ allow_private_ips=True,
)
if response.ok:
@@ -1045,15 +1045,14 @@ def check_overdue_subscriptions():
# Make HTTP request to research API
from flask import request
- # Use localhost for internal self-call (server is always reachable at 127.0.0.1)
- settings_manager = get_settings_manager()
- port = settings_manager.get_setting("web.port", 5000)
+ # Use request.host_url to get the actual URL the server is responding on
+ base_url = request.host_url.rstrip("/")
# Use the session from the current request to maintain authentication
session_cookie = request.cookies.get("session")
response = safe_post(
- f"http://127.0.0.1:{port}/research/api/start_research",
+ f"{base_url}/research/api/start_research",
json=request_data,
headers={
"Content-Type": "application/json",
@@ -1063,6 +1062,7 @@ def check_overdue_subscriptions():
},
timeout=30,
allow_localhost=True,
+ allow_private_ips=True,
)
if response.ok: