Fix issue in getting current request through classmethod when served through a different ASGI server (#2760)

This commit is contained in:
Thirumalaisamy K 2023-06-15 00:33:43 +05:30 committed by GitHub
parent af67801062
commit 50117d174c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -175,6 +175,7 @@ class ASGIApp:
instance.transport, instance.transport,
sanic_app, sanic_app,
) )
request_class._current.set(instance.request)
instance.request.stream = instance # type: ignore instance.request.stream = instance # type: ignore
instance.request_body = True instance.request_body = True
instance.request.conn_info = ConnInfo(instance.transport) instance.request.conn_info = ConnInfo(instance.transport)