Kaynağa Gözat

Only javascript files

Rodrigo Agundez 2 ay önce
ebeveyn
işleme
31ee7a68a2
1 değiştirilmiş dosya ile 4 ekleme ve 6 silme
  1. 4 6
      backend/open_webui/main.py

+ 4 - 6
backend/open_webui/main.py

@@ -330,13 +330,11 @@ class SPAStaticFiles(StaticFiles):
             return await super().get_response(path, scope)
             return await super().get_response(path, scope)
         except (HTTPException, StarletteHTTPException) as ex:
         except (HTTPException, StarletteHTTPException) as ex:
             if ex.status_code == 404:
             if ex.status_code == 404:
-                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
+                if path.endswith(".js"):
+                    # Return 404 for javascript files
                     raise ex
                     raise ex
+                else:
+                    return await super().get_response("index.html", scope)
             else:
             else:
                 raise ex
                 raise ex