diff --git a/tools/misp-workflows/webhook-listener.py b/tools/misp-workflows/webhook-listener.py index bb08f5848..400bb94ae 100755 --- a/tools/misp-workflows/webhook-listener.py +++ b/tools/misp-workflows/webhook-listener.py @@ -24,8 +24,13 @@ class MyServer(BaseHTTPRequestHandler): self.send_header("Content-type", "text/html") self.end_headers() self.data_string = self.rfile.read(int(self.headers['Content-Length'])) - data = json.loads(self.data_string) - pprint(data) + self.data_string = self.data_string.decode('utf8') + try: + data = json.loads(self.data_string) + pprint(data) + except json.decoder.JSONDecodeError as e: + data = self.data_string + print(data) print() self.wfile.write(bytes("https://pythonbasics.org", "utf-8")) self.wfile.write(bytes("

Request: %s

" % self.path, "utf-8"))