From 60d8fcace9adf5e423170589d2f41a77b6d22978 Mon Sep 17 00:00:00 2001 From: "fred.boniface" Date: Wed, 26 Aug 2026 17:43:12 +0100 Subject: [PATCH] Add improved Ziti status check --- launcher/checks.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/launcher/checks.py b/launcher/checks.py index fa09d11..b53e772 100644 --- a/launcher/checks.py +++ b/launcher/checks.py @@ -1,5 +1,7 @@ # checks.py import socket +import urllib.request +import urllib.error class SystemChecks: @@ -16,11 +18,21 @@ class SystemChecks: return False def check_ziti_status(self): - """Probes the configured Ziti target endpoint.""" + """Makes an HTTP request to the configured address.""" if not self.ziti_target: return False - host, port = self.ziti_target - return self._tcp_ping(host, int(port), timeout=1.0) + + try: + request = urllib.request.Request( + self.ziti_target, + method="GET", + ) + + with urllib.request.urlopen(request, timeout=2.0) as response: + return 200 <= response.status < 300 + + except (urllib.error.URLError, TimeoutError, OSError): + return False def _tcp_ping(self, host, port, timeout=1): try: