diff --git a/core/websocket_client.py b/core/websocket_client.py index 7cc5d09..e9ce953 100755 --- a/core/websocket_client.py +++ b/core/websocket_client.py @@ -214,6 +214,7 @@ class QingjianAPIClient: try: import httpx + trust_env = os.getenv("TIANWANG_CALLBACK_TRUST_ENV", "false").lower() in ("1", "true", "yes") payload = { "event": event, "timestamp": datetime.now().isoformat(), @@ -229,7 +230,7 @@ class QingjianAPIClient: } if extra: payload.update(extra) - async with httpx.AsyncClient(timeout=6) as client: + async with httpx.AsyncClient(timeout=6, trust_env=trust_env) as client: resp = await client.post(self._tianwang_callback_url, json=payload) ok = 200 <= resp.status_code < 300 self._activity_log(