diff --git a/sources/python/tap-proxy.py b/sources/python/tap-proxy.py index 5b36b8d..16948c8 100644 --- a/sources/python/tap-proxy.py +++ b/sources/python/tap-proxy.py @@ -39,8 +39,11 @@ class Tap(http.server.BaseHTTPRequestHandler): self.end_headers() self.wfile.write(resp.read()) except Exception as e: - msg += "\nERROR: " + str(e) + "\n" - self.send_error(502) + msg += "\nBACKEND: " + str(e) + "\n" + self.send_response(502) + self.send_header('Content-Type', 'text/plain') + self.end_headers() + self.wfile.write(b"Backend unreachable: " + str(e).encode()) with open(LOG, "a") as f: f.write(msg)