summaryrefslogtreecommitdiff
path: root/tests/wsgi_test.py
diff options
context:
space:
mode:
authorSergey Shepelev <temotor@gmail.com>2015-09-07 04:23:47 +0300
committerSergey Shepelev <temotor@gmail.com>2015-09-07 04:23:47 +0300
commitb443de322aed2b0f9f0d1aab3d24c1f7cd5bd2da (patch)
tree63aa781379b46ae8f7b7ed8950454f97414c7ad6 /tests/wsgi_test.py
parent4f015c2993be7ed90177cd43780cd1423cc932a1 (diff)
downloadeventlet-wsgi-drop-invalid.tar.gz
wsgi: improved request body discardwsgi-drop-invalid
- skip request body discarding when connection was to be closed anyway - handle ChunkReadError while discarding, write to log, close connection https://github.com/eventlet/eventlet/issues/27 https://github.com/eventlet/eventlet/issues/242
Diffstat (limited to 'tests/wsgi_test.py')
-rw-r--r--tests/wsgi_test.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/tests/wsgi_test.py b/tests/wsgi_test.py
index 4d67ede..00a5c45 100644
--- a/tests/wsgi_test.py
+++ b/tests/wsgi_test.py
@@ -1638,7 +1638,6 @@ class ProxiedIterableAlreadyHandledTest(IterableAlreadyHandledTest):
class TestChunkedInput(_TestBase):
- dirt = ""
validator = None
def application(self, env, start_response):
@@ -1687,16 +1686,13 @@ class TestChunkedInput(_TestBase):
self.site = Site()
self.site.application = self.application
- def chunk_encode(self, chunks, dirt=None):
- if dirt is None:
- dirt = self.dirt
-
+ def chunk_encode(self, chunks, dirt=""):
b = ""
for c in chunks:
b += "%x%s\r\n%s\r\n" % (len(c), dirt, c)
return b
- def body(self, dirt=None):
+ def body(self, dirt=""):
return self.chunk_encode(["this", " is ", "chunked", "\nline",
" 2", "\n", "line3", ""], dirt=dirt)