Keep the SSRF-safe transport in clientForConfig (closes #69)
Some checks failed
check / check (push) Has been cancelled

This commit is contained in:
2026-08-07 18:58:44 +07:00
parent 2cc8723997
commit 6b14fc847d
3 changed files with 129 additions and 0 deletions

View File

@@ -1713,10 +1713,15 @@ func (e *Engine) clientForConfig(
cfg *HTTPTargetConfig,
) *http.Client {
if cfg.Timeout > 0 {
// Reuse the shared client's SSRF-safe transport so
// a per-target timeout does not drop the
// request-time private-IP guard. Only the timeout
// is overridden.
return &http.Client{
Timeout: time.Duration(
cfg.Timeout,
) * time.Second,
Transport: e.client.Transport,
}
}