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