mirror of
https://github.com/open-webui/open-webui
synced 2025-06-04 03:37:35 +00:00
Only javascript files
This commit is contained in:
parent
5d68737b31
commit
31ee7a68a2
@ -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"):
|
if path.endswith(".js"):
|
||||||
response = await super().get_response("index.html", scope)
|
# Return 404 for javascript files
|
||||||
response.status_code = 200
|
|
||||||
return response
|
|
||||||
else:
|
|
||||||
# Return 404 for non-HTML files
|
|
||||||
raise ex
|
raise ex
|
||||||
|
else:
|
||||||
|
return await super().get_response("index.html", scope)
|
||||||
else:
|
else:
|
||||||
raise ex
|
raise ex
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user