From 5fd2933d2e54a7b5781698a670abf89b1031db44 Mon Sep 17 00:00:00 2001 From: Max Romanov Date: Tue, 10 Nov 2020 22:27:08 +0300 Subject: Python: supporting ASGI legacy protocol. Introducing manual protocol selection for 'universal' apps and frameworks. --- test/python/legacy/asgi.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 test/python/legacy/asgi.py (limited to 'test/python/legacy/asgi.py') diff --git a/test/python/legacy/asgi.py b/test/python/legacy/asgi.py new file mode 100644 index 00000000..f065d026 --- /dev/null +++ b/test/python/legacy/asgi.py @@ -0,0 +1,13 @@ +def application(scope): + assert scope['type'] == 'http' + + return app_http + +async def app_http(receive, send): + await send({ + 'type': 'http.response.start', + 'status': 200, + 'headers': [ + (b'content-length', b'0'), + ] + }) -- cgit