xref: /unit/test/python/legacy_force/asgi.py (revision 1848:4bd548074e2c)
1def application(scope, receive=None, send=None):
2    assert scope['type'] == 'http'
3
4    if receive == None and send == None:
5        return app_http
6
7    else:
8        return app_http(receive, send)
9
10
11async def app_http(receive, send):
12    await send(
13        {
14            'type': 'http.response.start',
15            'status': 200,
16            'headers': [(b'content-length', b'0'),],
17        }
18    )
19