xref: /unit/test/python/input_read_length/wsgi.py (revision 603:a11b80dedc6b)
1*603Szelenkov@nginx.comdef application(environ, start_response):
2*603Szelenkov@nginx.com
3*603Szelenkov@nginx.com    input_length = int(environ.get('HTTP_INPUT_LENGTH'))
4*603Szelenkov@nginx.com    body = bytes(environ['wsgi.input'].read(input_length))
5*603Szelenkov@nginx.com
6*603Szelenkov@nginx.com    start_response('200', [('Content-Length', str(len(body)))])
7*603Szelenkov@nginx.com    return [body]
8