Set content-type charset in influxdb output and allow it be overridden (#3593)
(cherry picked from commit 4f7afb8cb5
)
This commit is contained in:
parent
223bbf0df7
commit
83faea7a31
|
@ -211,11 +211,12 @@ func (c *httpClient) makeRequest(uri string, body io.Reader) (*http.Request, err
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
req.Header.Set("Content-Type", "text/plain; charset=utf-8")
|
||||||
|
|
||||||
for header, value := range c.config.HTTPHeaders {
|
for header, value := range c.config.HTTPHeaders {
|
||||||
req.Header.Set(header, value)
|
req.Header.Set(header, value)
|
||||||
}
|
}
|
||||||
|
|
||||||
req.Header.Set("Content-Type", "text/plain")
|
|
||||||
req.Header.Set("User-Agent", c.config.UserAgent)
|
req.Header.Set("User-Agent", c.config.UserAgent)
|
||||||
if c.config.Username != "" && c.config.Password != "" {
|
if c.config.Username != "" && c.config.Password != "" {
|
||||||
req.SetBasicAuth(c.config.Username, c.config.Password)
|
req.SetBasicAuth(c.config.Username, c.config.Password)
|
||||||
|
|
Loading…
Reference in New Issue