tofarr преди 1 година
родител
ревизия
4ebff5aaf3
променени са 1 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 2 2
      openhands/server/middleware.py

+ 2 - 2
openhands/server/middleware.py

@@ -14,7 +14,7 @@ class LocalhostCORSMiddleware(CORSMiddleware):
     def __init__(self, app: ASGIApp, **kwargs) -> None:
         super().__init__(app, **kwargs)
 
-    async def is_allowed_origin(self, origin: str) -> bool:
+    def is_allowed_origin(self, origin: str) -> bool:
         if origin:
             parsed = urlparse(origin)
             hostname = parsed.hostname or ''
@@ -24,7 +24,7 @@ class LocalhostCORSMiddleware(CORSMiddleware):
                 return True
 
         # For missing origin or other origins, use the parent class's logic
-        return await super().is_allowed_origin(origin)
+        return super().is_allowed_origin(origin)
 
 
 class NoCacheMiddleware(BaseHTTPMiddleware):