fix: disable env proxy by default for Tianwang callback requests

This commit is contained in:
2026-03-01 17:41:11 +08:00
parent 5c1f33114f
commit 13f61d2fc0

View File

@@ -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(