From 50117d174c1fe218a994e4e493b9016f53e00380 Mon Sep 17 00:00:00 2001 From: Thirumalaisamy K <39087394+Thirumalai@users.noreply.github.com> Date: Thu, 15 Jun 2023 00:33:43 +0530 Subject: [PATCH] Fix issue in getting current request through classmethod when served through a different ASGI server (#2760) --- sanic/asgi.py | 1 + 1 file changed, 1 insertion(+) diff --git a/sanic/asgi.py b/sanic/asgi.py index ad2f9d2d..43a111a3 100644 --- a/sanic/asgi.py +++ b/sanic/asgi.py @@ -175,6 +175,7 @@ class ASGIApp: instance.transport, sanic_app, ) + request_class._current.set(instance.request) instance.request.stream = instance # type: ignore instance.request_body = True instance.request.conn_info = ConnInfo(instance.transport)