feat(influxdb): use database auth if provided

closes #6310
This commit is contained in:
bergquist
2016-10-18 15:12:04 +02:00
parent 2b55cf609c
commit 9429434cb5
4 changed files with 99 additions and 76 deletions
+5
View File
@@ -124,10 +124,15 @@ func (e *InfluxDBExecutor) createRequest(query string) (*http.Request, error) {
req.URL.RawQuery = params.Encode()
req.Header.Set("User-Agent", "Grafana")
if e.BasicAuth {
req.SetBasicAuth(e.BasicAuthUser, e.BasicAuthPassword)
}
if e.User != "" {
req.SetBasicAuth(e.User, e.Password)
}
glog.Debug("Influxdb request", "url", req.URL.String())
return req, nil
}