aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2022-11-26 15:36:02 +0000
committerVsevolod Stakhov <vsevolod@rspamd.com>2022-11-26 15:36:02 +0000
commit4d2c290632013e962c59ccc81485792aec5ad8d1 (patch)
tree5c8a0090de3b99b37b086e3d7b0910920c58a4b8 /test
parent4febe1a1d628f134787c3dab0ed8c4fc7d7ac597 (diff)
downloadrspamd-4d2c290632013e962c59ccc81485792aec5ad8d1.tar.gz
rspamd-4d2c290632013e962c59ccc81485792aec5ad8d1.zip
[Test] Add endpoint for settings tests
Diffstat (limited to 'test')
-rwxr-xr-xtest/functional/util/dummy_http.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/functional/util/dummy_http.py b/test/functional/util/dummy_http.py
index 6ca084403..92b538845 100755
--- a/test/functional/util/dummy_http.py
+++ b/test/functional/util/dummy_http.py
@@ -71,6 +71,7 @@ class MyHandler(http.server.BaseHTTPRequestHandler):
"""Respond to a POST request."""
response = b"hello post"
content_length = int(self.headers.get('Content-Length', "0")) or 0
+ content_type = "text/plain"
if content_length > 0:
_ = self.rfile.read(content_length)
if self.path == "/empty":
@@ -86,6 +87,9 @@ class MyHandler(http.server.BaseHTTPRequestHandler):
self.send_response(200)
if self.path == "/map-simple":
response = b"hello map"
+ if self.path == "/settings":
+ response = b"{\"actions\": { \"reject\": 1.0}}"
+ content_type = "application/json"
self.send_header("Content-Length", str(len(response)))
conntype = self.headers.get('Connection', "").lower()
@@ -94,7 +98,7 @@ class MyHandler(http.server.BaseHTTPRequestHandler):
else:
self.send_header("Connection", "keep-alive")
- self.send_header("Content-type", "text/plain")
+ self.send_header("Content-type", content_type)
self.end_headers()
self.wfile.write(response)
self.log_message("to be closed: %d, headers: %s, conn:'%s'" % (self.close_connection, str(self.headers), self.headers.get('Connection', "").lower()))