Files
nginx-unit/test/python/input_read_length/wsgi.py
2018-04-02 17:03:41 +03:00

8 lines
242 B
Python

def application(environ, start_response):
input_length = int(environ.get('HTTP_INPUT_LENGTH'))
body = bytes(environ['wsgi.input'].read(input_length))
start_response('200', [('Content-Length', str(len(body)))])
return [body]