Skip to content

Commit

Permalink
Add X-Requested-By header (#272)
Browse files Browse the repository at this point in the history
  • Loading branch information
Marius Sturm authored and bernd committed Aug 14, 2018
1 parent 1a6ca34 commit 0f33ee7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions api/rest/rest.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import (
var (
log = logger.Log()
userAgent = "Graylog Collector v" + common.CollectorVersion
customRequestHeader = "sidecar"
)

const (
Expand Down Expand Up @@ -132,6 +133,7 @@ func (c *Client) NewRequest(method, urlStr string, params map[string]string, bod
req.Header.Add("Accept", mediaType)
req.Header.Add("User-Agent", userAgent)
req.Header.Add("X-Graylog-Sidecar-Version", common.CollectorVersion)
req.Header.Add("X-Requested-By", customRequestHeader)
req.SetBasicAuth(c.ApiToken, "token")
return req, nil
}
Expand Down

0 comments on commit 0f33ee7

Please sign in to comment.