fix(webfetch): add ok check for type assertion in isAllowedFirstHopHost

This commit is contained in:
程智超0668000959
2026-06-08 17:25:44 +08:00
parent 12c36572a5
commit a4e8fe953e
+2 -2
View File
@@ -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)