wsgi.py (674:092a1befab12) wsgi.py (1848:4bd548074e2c)
1def application(environ, start_response):
2
3 content_length = int(environ.get('CONTENT_LENGTH', 0))
4 body = bytes(environ['wsgi.input'].read(content_length))
5
1def application(environ, start_response):
2
3 content_length = int(environ.get('CONTENT_LENGTH', 0))
4 body = bytes(environ['wsgi.input'].read(content_length))
5
6 start_response('200', [
7 ('Content-Type', environ.get('CONTENT_TYPE')),
8 ('Content-Length', str(len(body))),
9 ('Request-Method', environ.get('REQUEST_METHOD')),
10 ('Request-Uri', environ.get('REQUEST_URI')),
11 ('Http-Host', environ.get('HTTP_HOST')),
12 ('Server-Protocol', environ.get('SERVER_PROTOCOL')),
13 ('Server-Software', environ.get('SERVER_SOFTWARE')),
14 ('Custom-Header', environ.get('HTTP_CUSTOM_HEADER')),
15 ('Wsgi-Version', str(environ['wsgi.version'])),
16 ('Wsgi-Url-Scheme', environ['wsgi.url_scheme']),
17 ('Wsgi-Multithread', str(environ['wsgi.multithread'])),
18 ('Wsgi-Multiprocess', str(environ['wsgi.multiprocess'])),
19 ('Wsgi-Run-Once', str(environ['wsgi.run_once']))
20 ])
6 start_response(
7 '200',
8 [
9 ('Content-Type', environ.get('CONTENT_TYPE')),
10 ('Content-Length', str(len(body))),
11 ('Request-Method', environ.get('REQUEST_METHOD')),
12 ('Request-Uri', environ.get('REQUEST_URI')),
13 ('Http-Host', environ.get('HTTP_HOST')),
14 ('Server-Protocol', environ.get('SERVER_PROTOCOL')),
15 ('Server-Software', environ.get('SERVER_SOFTWARE')),
16 ('Custom-Header', environ.get('HTTP_CUSTOM_HEADER')),
17 ('Wsgi-Version', str(environ['wsgi.version'])),
18 ('Wsgi-Url-Scheme', environ['wsgi.url_scheme']),
19 ('Wsgi-Multithread', str(environ['wsgi.multithread'])),
20 ('Wsgi-Multiprocess', str(environ['wsgi.multiprocess'])),
21 ('Wsgi-Run-Once', str(environ['wsgi.run_once'])),
22 ],
23 )
21 return [body]
24 return [body]