fix(provider): set default HTTP client timeout when timeout is non-positive

This commit is contained in:
tong3jie 2026-03-23 17:49:33 +08:00
parent 8c9f6c5a6c
commit bb1f85cb3e

View file

@ -71,6 +71,8 @@ func WithRequestTimeout(timeout time.Duration) Option {
return func(p *Provider) { return func(p *Provider) {
if timeout > 0 { if timeout > 0 {
p.httpClient.Timeout = timeout p.httpClient.Timeout = timeout
} else {
p.httpClient.Timeout = defaultRequestTimeout
} }
} }
} }