Tests: added tests for response header variables.

This commit is contained in:
Andrei Zeliankou
2023-07-11 15:51:53 +01:00
parent 458722df55
commit 2ad03caf32
2 changed files with 111 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
def application(environ, start_response):
content_length = int(environ.get('CONTENT_LENGTH', 0))
body = bytes(environ['wsgi.input'].read(content_length))
header_transfer = environ.get('HTTP_X_TRANSFER')
header_length = environ.get('HTTP_X_LENGTH')
headers = []
if header_length:
headers.append(('Content-Length', '0'))
if header_transfer:
headers.append(('Transfer-Encoding', header_transfer))
start_response('200', headers)
return [body]