fix: add bots.qq.com and api.sgroup.qq.com to SSRF trusted hosts

QQ Bot adapter fails to connect in mainland China because DNS fake IP
(198.18.0.0/15) is blocked by SSRF protection. Commit a97b08e added
multimedia.nt.qq.com.cn to _TRUSTED_PRIVATE_IP_HOSTS, but QQ Bot also
uses bots.qq.com (OAuth token endpoint) and api.sgroup.qq.com
(WebSocket gateway), both of which resolve to the same benchmark IP
range.

Fixes #86081
This commit is contained in:
RelaxJonh 2026-08-14 20:31:13 +07:00
parent c896c09c42
commit d2c8d92c2c
1 changed files with 2 additions and 0 deletions

View File

@ -199,6 +199,8 @@ _ALWAYS_BLOCKED_NETWORKS = (
# to 198.18.0.0/15 behind local proxy/benchmark infrastructure.
_TRUSTED_PRIVATE_IP_HOSTS = frozenset({
"multimedia.nt.qq.com.cn",
"bots.qq.com",
"api.sgroup.qq.com",
})
_MAX_SSRF_CONNECT_IPS = 8