Python: supporting ASGI legacy protocol.
Introducing manual protocol selection for 'universal' apps and frameworks.
This commit is contained in:
17
test/python/legacy_force/asgi.py
Normal file
17
test/python/legacy_force/asgi.py
Normal file
@@ -0,0 +1,17 @@
|
||||
def application(scope, receive=None, send=None):
|
||||
assert scope['type'] == 'http'
|
||||
|
||||
if receive == None and send == None:
|
||||
return app_http
|
||||
|
||||
else:
|
||||
return app_http(receive, send)
|
||||
|
||||
async def app_http(receive, send):
|
||||
await send({
|
||||
'type': 'http.response.start',
|
||||
'status': 200,
|
||||
'headers': [
|
||||
(b'content-length', b'0'),
|
||||
]
|
||||
})
|
||||
Reference in New Issue
Block a user