This repository has been archived on 2026-07-15. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
drive/backend/handlers/httpclient.go
Elijah 701766b611
Some checks failed
Automated Container Build / build-and-push (push) Has been cancelled
chore: implement Phase 1 and 2 security remediations
2026-05-26 13:32:09 -07:00

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,
},
}