Skip to content

Commit

Permalink
Add X-Requested-By header (#274)
Browse files Browse the repository at this point in the history
* Add X-Requested-By header (#272)

(cherry picked from commit 0f33ee7)

* Add Graylog 2.5 to compatibility matrix
  • Loading branch information
Marius Sturm authored and bernd committed Aug 16, 2018
1 parent 77045b2 commit b278ceb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Especially the [Step-by-Step](http://docs.graylog.org/en/2.4/pages/collector_sid
| ---------------- | ---------------------- |
| 0.0.9 | 2.1.x |
| 0.1.x | 2.2.x, 2.3.x, 2.4.x |
| 0.2.x | 2.5.x |

[Download a package](https://github.com/Graylog2/collector-sidecar/releases) and install it on the target system.

Expand Down
2 changes: 2 additions & 0 deletions api/rest/rest.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import (
var (
log = logger.Log()
userAgent = "Graylog Collector v" + common.CollectorVersion
customRequestHeader = "sidecar"
)

const (
Expand Down Expand Up @@ -130,6 +131,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-Collector-Version", common.CollectorVersion)
req.Header.Add("X-Requested-By", customRequestHeader)
return req, nil
}

Expand Down

0 comments on commit b278ceb

Please sign in to comment.