From fb3660dbbfdf485abd0bd115d66f992b375b0eb4 Mon Sep 17 00:00:00 2001 From: Marius Sturm Date: Tue, 14 Aug 2018 14:57:48 +0200 Subject: [PATCH] Add X-Requested-By header (#272) (cherry picked from commit 0f33ee7fc5f9934f6da038902760011d15309a18) --- api/rest/rest.go | 2 ++ 1 file changed, 2 insertions(+) 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 }