summaryrefslogtreecommitdiff
path: root/waitress/tests/fixtureapps/badcl.py
blob: 96948b617dd921c86a178c6e6526d4bd4efcdf24 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
def app(environ, start_response):
    body = 'abcdefghi'
    cl = len(body)
    if environ['PATH_INFO'] == '/short_body':
        cl = len(body) +1
    if environ['PATH_INFO'] == '/long_body':
        cl = len(body) -1
    start_response(
        '200 OK',
        [('Content-Length', str(cl)), ('Content-Type', 'text/plain')]
        )
    return [body]

if __name__ == '__main__':
    from waitress import serve
    serve(app, port=61523, verbose=False)