This commit is contained in:
@@ -806,6 +806,8 @@ if static_dir.exists():
|
||||
|
||||
@app.get("/{path:path}", include_in_schema=False)
|
||||
async def spa(path: str):
|
||||
if path == "api" or path.startswith("api/"):
|
||||
raise HTTPException(status_code=404, detail="Not Found")
|
||||
root = static_dir.resolve()
|
||||
target = (root / path).resolve()
|
||||
headers = {"Cache-Control": "no-cache, no-store, must-revalidate, max-age=0"}
|
||||
|
||||
Reference in New Issue
Block a user