mirror of
https://github.com/sipeed/picoclaw.git
synced 2026-06-12 18:08:54 +00:00
Merge pull request #3058 from chengzhichao-xydt/codex/webfetch-allowed-host-type-assert
fix(webfetch): add ok check for type assertion in isAllowedFirstHopHost
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user