diff --git a/backend/open_webui/main.py b/backend/open_webui/main.py index 2b741a2bc..2086b50ee 100644 --- a/backend/open_webui/main.py +++ b/backend/open_webui/main.py @@ -330,7 +330,13 @@ class SPAStaticFiles(StaticFiles): return await super().get_response(path, scope) except (HTTPException, StarletteHTTPException) as ex: if ex.status_code == 404: - return await super().get_response("index.html", scope) + if path.endswith(".html"): + response = await super().get_response("index.html", scope) + response.status_code = 200 + return response + else: + # Return 404 for non-HTML files + raise ex else: raise ex