summaryrefslogtreecommitdiffhomepage
path: root/test/python/chunked
diff options
context:
space:
mode:
authorAndrei Zeliankou <zelenkov@nginx.com>2023-07-11 15:51:53 +0100
committerAndrei Zeliankou <zelenkov@nginx.com>2023-07-11 15:51:53 +0100
commit2ad03caf327ce1e88b4d45112cf75480bb12a436 (patch)
tree3af123e19ea02464bc309ab258a78b4b7a42d9f4 /test/python/chunked
parent458722df55bb9727680b7734e7fff8fb5639db28 (diff)
downloadunit-2ad03caf327ce1e88b4d45112cf75480bb12a436.tar.gz
unit-2ad03caf327ce1e88b4d45112cf75480bb12a436.tar.bz2
Tests: added tests for response header variables.
Diffstat (limited to 'test/python/chunked')
-rw-r--r--test/python/chunked/wsgi.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/python/chunked/wsgi.py b/test/python/chunked/wsgi.py
new file mode 100644
index 00000000..23ee81fc
--- /dev/null
+++ b/test/python/chunked/wsgi.py
@@ -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]