aboutsummaryrefslogtreecommitdiffstats
path: root/test/functional/util
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2022-11-19 15:37:06 +0000
committerVsevolod Stakhov <vsevolod@rspamd.com>2022-11-19 15:37:06 +0000
commit0363f2dedae7a99b1ac6716f8e7d6d3a3c84f74d (patch)
treeeb2e6aebe21c4b80c4d97271d653ef3b0d572002 /test/functional/util
parent97137eeb575a48ced931a795dcc5b7868d3af439 (diff)
downloadrspamd-0363f2dedae7a99b1ac6716f8e7d6d3a3c84f74d.tar.gz
rspamd-0363f2dedae7a99b1ac6716f8e7d6d3a3c84f74d.zip
[Test] Another try to fix goddamned dummy http server
Diffstat (limited to 'test/functional/util')
-rwxr-xr-xtest/functional/util/dummy_http.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/test/functional/util/dummy_http.py b/test/functional/util/dummy_http.py
index 2ad4dcd40..6ca084403 100755
--- a/test/functional/util/dummy_http.py
+++ b/test/functional/util/dummy_http.py
@@ -70,8 +70,9 @@ class MyHandler(http.server.BaseHTTPRequestHandler):
def do_POST(self):
"""Respond to a POST request."""
response = b"hello post"
- content_length = int(self.headers['Content-Length'])
- body = self.rfile.read(content_length)
+ content_length = int(self.headers.get('Content-Length', "0")) or 0
+ if content_length > 0:
+ _ = self.rfile.read(content_length)
if self.path == "/empty":
self.finish()
return