From 0e3c4d152637f01e3bfd05b65478036f0109829f Mon Sep 17 00:00:00 2001 From: Archento Date: Fri, 23 Aug 2024 10:03:33 +0200 Subject: [PATCH] loosen access control rules --- python/src/uagents/asgi.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/python/src/uagents/asgi.py b/python/src/uagents/asgi.py index 1a74e468..4cdfda51 100644 --- a/python/src/uagents/asgi.py +++ b/python/src/uagents/asgi.py @@ -273,11 +273,13 @@ async def serve(self): host=HOST, port=self._port, log_level="warning", + forwarded_allow_ips="*", headers=[ ("Access-Control-Allow-Origin", "*"), ("Access-Control-Request-Method", "*"), - ("Access-Control-Allow-Methods", "OPTIONS, GET, POST"), + ("Access-Control-Allow-Methods", "*"), ("Access-Control-Allow-Headers", "*"), + ("Access-Control-Allow-Credentials", "true"), ], ) self._server = uvicorn.Server(config) @@ -290,7 +292,7 @@ async def serve(self): except KeyboardInterrupt: self._logger.info("Shutting down server") - async def __call__(self, scope, receive, send): # pylint: disable=too-many-branches + async def __call__(self, scope, receive, send): """ Handle an incoming ASGI message, dispatching the envelope to the appropriate handler, and waiting for any queries to be resolved.