From 278c652d6ff1a275690ed91a5e84ba6cfa001f0a Mon Sep 17 00:00:00 2001 From: Cory LaNou Date: Sat, 7 Mar 2015 07:27:35 -0700 Subject: [PATCH] send credentials if provided --- client/influxdb.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/influxdb.go b/client/influxdb.go index cb7ab54da0..d2569af488 100644 --- a/client/influxdb.go +++ b/client/influxdb.go @@ -47,6 +47,9 @@ func (c *Client) Query(q Query) (*Results, error) { u := c.url u.Path = "query" + if c.username != "" { + u.User = url.UserPassword(c.username, c.password) + } values := u.Query() values.Set("q", q.Command) values.Set("db", q.Database)