summaryrefslogblamecommitdiffhomepage
path: root/test/python/input_iter/wsgi.py
blob: 04a6a06c1b0a5b21615d4dd1902f1d2c4e86e6fa (plain) (tree)
1
2
3
4
                                         

                      
 











                                                    
def application(environ, start_response):
    body = []
    content_length = 0

    for l in environ['wsgi.input'].__iter__():
        body.append(l)
        content_length += len(l)

    start_response(
        '200',
        [
            ('Content-Length', str(content_length)),
            ('X-Lines-Count', str(len(body))),
        ],
    )
    return body