xref: /unit/test/python/input_iter/wsgi.py (revision 1400:cbd75efbfb74)
1def application(environ, start_response):
2    body = []
3    content_length = 0
4
5    for l in environ['wsgi.input'].__iter__():
6        body.append(l)
7        content_length += len(l)
8
9    start_response(
10        '200',
11        [
12            ('Content-Length', str(content_length)),
13            ('X-Lines-Count', str(len(body))),
14        ],
15    )
16    return body
17