# IMPORTANT: LEGACY V0 CODE # This file is part of the legacy (V0) implementation of OpenHands and will be removed soon as we complete the migration to V1. # OpenHands V1 uses the Software Agent SDK for the agentic core and runs a new application server. Please refer to: # - V1 agentic core (SDK): https://github.com/OpenHands/software-agent-sdk # - V1 application server (in this repo): openhands/app_server/ # Unless you are working on deprecation, please avoid extending this legacy file and consult the V1 codepaths above. # Tag: Legacy-V0 # This module belongs to the old V0 web server. The V1 application server lives under openhands/app_server/. 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)