Graham Neubig 154eed148f
Fix typing in server directory (#8375)
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: Rohit Malhotra <rohitvinodmalhotra@gmail.com>
2025-05-13 21:27:59 +00:00

13 lines
473 B
Python

from fastapi.staticfiles import StaticFiles
from starlette.responses import Response
from starlette.types import Scope
class SPAStaticFiles(StaticFiles):
async def get_response(self, path: str, scope: Scope) -> Response:
try:
return await super().get_response(path, scope)
except Exception:
# FIXME: just making this HTTPException doesn't work for some reason
return await super().get_response('index.html', scope)