From f413c8c586b1b97ac661ec3f81ae69e778b4b4c1 Mon Sep 17 00:00:00 2001 From: Sanskar Jethi Date: Tue, 26 Nov 2024 20:34:55 +0000 Subject: [PATCH] update --- robyn/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/robyn/__init__.py b/robyn/__init__.py index ca81226f..fe8b7028 100644 --- a/robyn/__init__.py +++ b/robyn/__init__.py @@ -607,6 +607,9 @@ def ALLOW_CORS(app: Robyn, origins: Union[List[str], str]): @app.before_request() def cors_middleware(request): + if request is None: + return None + origin = request.headers.get("Origin") # If specific origins are set, validate the request origin