Add ['asgi']['version'] = '3.0' when 3.0 is used.

This commit is contained in:
Tom Christie 2019-03-20 10:28:35 +00:00
parent 9d3259e7b8
commit 220c07b260

View File

@ -22,6 +22,8 @@ class ASGI3Middleware:
self.app = app self.app = app
def __call__(self, scope): def __call__(self, scope):
scope.setdefault("asgi", {})
scope["asgi"]["version"] = "3.0"
return functools.partial(self.asgi, scope=scope) return functools.partial(self.asgi, scope=scope)
async def asgi(self, receive, send, scope): async def asgi(self, receive, send, scope):