From 6b7eb19996f00b6fea9e358c56f1bed0bf7c1c7d Mon Sep 17 00:00:00 2001 From: Daniel Nelson Date: Thu, 28 Dec 2017 16:22:19 -0800 Subject: [PATCH] Set content-type charset in influxdb output and allow it be overridden (#3593) --- plugins/outputs/influxdb/client/http.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/outputs/influxdb/client/http.go b/plugins/outputs/influxdb/client/http.go index 4dea82a8d..601e40386 100644 --- a/plugins/outputs/influxdb/client/http.go +++ b/plugins/outputs/influxdb/client/http.go @@ -211,11 +211,12 @@ func (c *httpClient) makeRequest(uri string, body io.Reader) (*http.Request, err return nil, err } + req.Header.Set("Content-Type", "text/plain; charset=utf-8") + for header, value := range c.config.HTTPHeaders { req.Header.Set(header, value) } - req.Header.Set("Content-Type", "text/plain") req.Header.Set("User-Agent", c.config.UserAgent) if c.config.Username != "" && c.config.Password != "" { req.SetBasicAuth(c.config.Username, c.config.Password)