From 011a54803a28f1bef7e0cde54a28d786acfb65cd Mon Sep 17 00:00:00 2001 From: Milo Hyben Date: Fri, 12 Jan 2024 15:24:52 +1100 Subject: [PATCH] FIX: silenece linting no attribute msg for Middleware. --- api/server.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/server.py b/api/server.py index 574b341f5..1e7a482dd 100644 --- a/api/server.py +++ b/api/server.py @@ -140,11 +140,11 @@ async def exception_handler(request: Request, e: Exception): cors_middleware = middlewares[0] request_origin = request.headers.get('origin', '') - if cors_middleware and '*' in cors_middleware.options['allow_origins']: + if cors_middleware and '*' in cors_middleware.options['allow_origins']: # type: ignore[attr-defined] response.headers['Access-Control-Allow-Origin'] = '*' elif ( cors_middleware - and request_origin in cors_middleware.options['allow_origins'] + and request_origin in cors_middleware.options['allow_origins'] # type: ignore[attr-defined] ): response.headers['Access-Control-Allow-Origin'] = request_origin