Handle CORS and selectively cache responses for appropriate methods #1

Merged
prathamesh merged 12 commits from sk-cors-fix into main 2025-08-01 10:37:07 +00:00
Showing only changes of commit e44fa4f72b - Show all commits

View File

@ -31,17 +31,16 @@ class WebSocketProxy:
provider_ws, provider_session = provider_connection
try:
await asyncio.gather(
self._proxy_client_to_provider(ws, provider_ws, provider),
self._proxy_provider_to_client(provider_ws, ws, provider),
return_exceptions=True
)
finally:
# Clean up provider connection
if not provider_ws.closed:
await provider_ws.close()
await provider_session.close()
await asyncio.gather(
self._proxy_client_to_provider(ws, provider_ws, provider),
self._proxy_provider_to_client(provider_ws, ws, provider),
return_exceptions=True
)
# Clean up provider connection
if not provider_ws.closed:
await provider_ws.close()
await provider_session.close()
except Exception as e:
self.logger.error(f"WebSocket proxy error: {e}")