Add Traefik Crowdsec Plugin Basic User Agent (#192)

*  Add Traefik Crowdsec Plugin Basic User Agent
This commit is contained in:
mathieuHa
2024-10-05 13:15:34 +02:00
committed by GitHub
parent 45d5f38c4d
commit 8fb0a016b6

View File

@@ -552,6 +552,8 @@ func crowdsecQuery(bouncer *Bouncer, stringURL string, isPost bool) ([]byte, err
req, _ = http.NewRequest(http.MethodGet, stringURL, nil)
}
req.Header.Add(bouncer.crowdsecHeader, bouncer.crowdsecKey)
req.Header.Add("User-Agent", "Crowdsec bouncer Traefik Plugin")
res, err := bouncer.httpClient.Do(req)
if err != nil {
return nil, fmt.Errorf("crowdsecQuery:unreachable url:%s %w", stringURL, err)