From 2828737562bfb9eb92df9e123e7197a35ea13bc7 Mon Sep 17 00:00:00 2001 From: arabcoders Date: Mon, 12 May 2025 17:15:21 +0300 Subject: [PATCH] skip auth for OPTIONS request --- app/library/HttpAPI.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/library/HttpAPI.py b/app/library/HttpAPI.py index 9f65c0cb..cc5aad30 100644 --- a/app/library/HttpAPI.py +++ b/app/library/HttpAPI.py @@ -305,6 +305,10 @@ class HttpAPI(Common): @web.middleware async def middleware_handler(request: Request, handler: RequestHandler) -> Response: + # if OPTIONS request, skip auth + if request.method == "OPTIONS": + return await handler(request) + auth_header = request.headers.get("Authorization") if auth_header is None and request.query.get("apikey") is not None: auth_header = f"Basic {request.query.get('apikey')}"