xref: /unit/test/python/input_readline_size/wsgi.py (revision 1400:cbd75efbfb74)
1def application(environ, start_response):
2    body = []
3
4    while True:
5        l = environ['wsgi.input'].readline(9)
6        if not l:
7            break
8
9        body.append(l)
10
11        if len(l) > 9:
12            body.append(b'len(l) > 9: ' + l)
13            break
14
15    start_response('200', [('X-Lines-Count', str(len(body)))])
16    return body
17