fix(webfetch): add ok check for type assertion in isAllowedFirstHopHost
This commit is contained in:
parent
12c36572a5
commit
a4e8fe953e
1 changed files with 2 additions and 2 deletions
|
|
@ -2419,8 +2419,8 @@ func allowConfiguredProxyFirstHop(req *http.Request, rt http.RoundTripper) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func isAllowedFirstHopHost(ctx context.Context, host string) bool {
|
func isAllowedFirstHopHost(ctx context.Context, host string) bool {
|
||||||
allowed, _ := ctx.Value(webFetchAllowedFirstHopHostKey{}).(string)
|
allowed, ok := ctx.Value(webFetchAllowedFirstHopHostKey{}).(string)
|
||||||
if allowed == "" {
|
if !ok || allowed == "" {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
return allowed == normalizeAllowedFirstHopHost(host)
|
return allowed == normalizeAllowedFirstHopHost(host)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue