Stop following redirects on the AppSec call

This commit is contained in:
Viktor Liu
2026-09-23 08:52:14 +02:00
parent 87103f9933
commit 780d63171b
2 changed files with 31 additions and 0 deletions
+5
View File
@@ -216,6 +216,11 @@ func New(cfg Config) (*Client, error) {
logger: logger,
http: &http.Client{
Timeout: timeout,
// Never follow a redirect: net/http would carry the API key header and
// the mirrored client request to whatever host the Location names.
CheckRedirect: func(*http.Request, []*http.Request) error {
return http.ErrUseLastResponse
},
Transport: &http.Transport{
MaxIdleConns: 100,
MaxIdleConnsPerHost: 32,