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 white page under load by fixing static file MIME types (#2323)

LearningCircuitdbe0cabdcd78
diff --git a/src/local_deep_research/web/app_factory.py b/src/local_deep_research/web/app_factory.py
index f564a5b12a..8d2e9e3234 100644
--- a/src/local_deep_research/web/app_factory.py
+++ b/src/local_deep_research/web/app_factory.py
@@ -7,6 +7,7 @@ from importlib import resources as importlib_resources
from flask import (
Flask,
Request,
+ abort,
jsonify,
make_response,
request,
@@ -753,7 +754,7 @@ def register_blueprints(app):
if validated_path and validated_path.exists():
return send_from_directory(str(dist_dir), path)
- except (ValueError, Exception):
+ except ValueError:
# Path validation failed, try regular static folder
pass
@@ -765,11 +766,11 @@ def register_blueprints(app):
if validated_path and validated_path.exists():
return send_from_directory(str(static_dir), path)
- except (ValueError, Exception):
+ except ValueError:
# Path validation failed
pass
- return make_response(jsonify({"error": "Not found"}), 404)
+ abort(404)
def register_error_handlers(app):
@@ -777,11 +778,15 @@ def register_error_handlers(app):
@app.errorhandler(404)
def not_found(error):
- return make_response(jsonify({"error": "Not found"}), 404)
+ if request.path.startswith("/api/"):
+ return make_response(jsonify({"error": "Not found"}), 404)
+ return make_response("Not found", 404)
@app.errorhandler(500)
def server_error(error):
- return make_response(jsonify({"error": "Server error"}), 500)
+ if request.path.startswith("/api/"):
+ return make_response(jsonify({"error": "Server error"}), 500)
+ return make_response("Server error", 500)
# Handle CSRF validation errors with helpful message
try: