From 19de2732f24c13b822e2ea281e3484f881966137 Mon Sep 17 00:00:00 2001 From: grossmj Date: Thu, 29 Sep 2022 15:11:15 +0200 Subject: [PATCH] Upgrade to FastAPI 0.85.0 and check embedded web-ui index.html can be found. --- gns3server/api/routes/index.py | 3 +++ requirements.txt | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/gns3server/api/routes/index.py b/gns3server/api/routes/index.py index 571ee2fd..0d64828b 100644 --- a/gns3server/api/routes/index.py +++ b/gns3server/api/routes/index.py @@ -55,6 +55,9 @@ async def web_ui(file_path: str): if static is None or not os.path.exists(static): static = get_resource(os.path.join("static", "web-ui", "index.html")) + if static is None: + raise HTTPException(status_code=status.HTTP_404_NOT_FOUND) + # guesstype prefers to have text/html type than application/javascript # which results with warnings in Firefox 66 on Windows # Ref. gns3-server#1559 diff --git a/requirements.txt b/requirements.txt index 65f1a0b0..f90ede6b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ uvicorn==0.18.3 -fastapi==0.84.0 +fastapi==0.85.0 python-multipart==0.0.5 websockets==10.3 aiohttp==3.8.1