From 204d29f094e53e05143e061b0d92eb58119610a1 Mon Sep 17 00:00:00 2001 From: krassowski <5832902+krassowski@users.noreply.github.com> Date: Sun, 11 Feb 2024 12:21:39 +0000 Subject: [PATCH] Do not touch coroutines --- jupyter_server/auth/decorator.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/jupyter_server/auth/decorator.py b/jupyter_server/auth/decorator.py index bb83c29933..4ac8a75689 100644 --- a/jupyter_server/auth/decorator.py +++ b/jupyter_server/auth/decorator.py @@ -106,12 +106,8 @@ def allow_unauthenticated(method: FuncT) -> FuncT: """ @wraps(method) - async def wrapper(self, *args, **kwargs): - out = method(self, *args, **kwargs) - # If the method is a coroutine, await it - if asyncio.iscoroutine(out): - return await out - return out + def wrapper(self, *args, **kwargs): + return method(self, *args, **kwargs) setattr(wrapper, "__allow_unauthenticated", True)