From 4f7afb8cb5abb89f3f67c8e677bfa9fc057874d6 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 4dea82a8d984a..601e40386c3f3 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)