From a4e8fe953e29fc6733a04fcff9dba9f10fadfc1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A8=8B=E6=99=BA=E8=B6=850668000959?= Date: Mon, 8 Jun 2026 17:25:44 +0800 Subject: [PATCH] fix(webfetch): add ok check for type assertion in isAllowedFirstHopHost --- pkg/tools/integration/web.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/tools/integration/web.go b/pkg/tools/integration/web.go index 4a50d3e55..70ca33b3c 100644 --- a/pkg/tools/integration/web.go +++ b/pkg/tools/integration/web.go @@ -2419,8 +2419,8 @@ func allowConfiguredProxyFirstHop(req *http.Request, rt http.RoundTripper) { } func isAllowedFirstHopHost(ctx context.Context, host string) bool { - allowed, _ := ctx.Value(webFetchAllowedFirstHopHostKey{}).(string) - if allowed == "" { + allowed, ok := ctx.Value(webFetchAllowedFirstHopHostKey{}).(string) + if !ok || allowed == "" { return false } return allowed == normalizeAllowedFirstHopHost(host)