xref: /unit/test/python/log_body/wsgi.py (revision 1437:1990c369a0b9)
1def application(environ, start_response):
2    content_length = int(environ.get('CONTENT_LENGTH', 0))
3    body = bytes(environ['wsgi.input'].read(content_length))
4
5    environ['wsgi.errors'].write(body.decode())
6    environ['wsgi.errors'].flush()
7
8    start_response('200', [('Content-Length', '0')])
9    return []
10