Skip to content

Commit

Permalink
enhance: add crowdsec user agent to cti do request func (#3130)
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurenceJJones committed Jul 15, 2024
1 parent c4da277 commit 84c214a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/cticlient/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"net/http"
"strings"

"github.com/crowdsecurity/crowdsec/pkg/cwversion"
log "github.com/sirupsen/logrus"
)

Expand Down Expand Up @@ -43,7 +44,10 @@ func (c *CrowdsecCTIClient) doRequest(method string, endpoint string, params map
if err != nil {
return nil, err
}

req.Header.Set("X-Api-Key", c.apiKey)
req.Header.Set("User-Agent", cwversion.UserAgent())

resp, err := c.httpClient.Do(req)
if err != nil {
return nil, err
Expand Down

0 comments on commit 84c214a

Please sign in to comment.