From b278ceb0112ceb11334f1b98580de042ab43851c Mon Sep 17 00:00:00 2001 From: Marius Sturm Date: Thu, 16 Aug 2018 15:17:21 +0200 Subject: [PATCH] Add X-Requested-By header (#274) * Add X-Requested-By header (#272) (cherry picked from commit 0f33ee7fc5f9934f6da038902760011d15309a18) * Add Graylog 2.5 to compatibility matrix --- README.md | 1 + api/rest/rest.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/README.md b/README.md index dce0437..d5a9b48 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/api/rest/rest.go b/api/rest/rest.go index cd5dfa7..da1337c 100644 --- a/api/rest/rest.go +++ b/api/rest/rest.go @@ -35,6 +35,7 @@ import ( var ( log = logger.Log() userAgent = "Graylog Collector v" + common.CollectorVersion + customRequestHeader = "sidecar" ) const ( @@ -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 }