summaryrefslogblamecommitdiffhomepage
path: root/test/python/server_port/asgi.py
blob: 810a182c64fdb3a985116c12396aeaffa171bbf6 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13


                                            









                                                                   
async def application(scope, receive, send):
    assert scope['type'] == 'http'

    await send(
        {
            'type': 'http.response.start',
            'status': 200,
            'headers': [
                (b'content-length', b'0'),
                (b'server-port', str(scope['server'][1]).encode()),
            ],
        }
    )