Some checks failed
Automated Container Build / build-and-push (push) Has been cancelled
19 lines
457 B
Go
19 lines
457 B
Go
package handlers
|
|
|
|
import (
|
|
"net/http"
|
|
"time"
|
|
)
|
|
|
|
// SafeHTTPClient is a shared client for all outbound requests.
|
|
// It enforces timeouts and prevents indefinite hangs.
|
|
var SafeHTTPClient = &http.Client{
|
|
Timeout: 30 * time.Second,
|
|
Transport: &http.Transport{
|
|
TLSHandshakeTimeout: 10 * time.Second,
|
|
ResponseHeaderTimeout: 15 * time.Second,
|
|
IdleConnTimeout: 30 * time.Second,
|
|
MaxIdleConns: 10,
|
|
DisableKeepAlives: false,
|
|
},
|
|
}
|