Merge pull request #360 from icholy/master

Omit zero value query time
This commit is contained in:
Björn Rabenstein 2017-11-20 18:45:06 +01:00 committed by GitHub
commit 1cdba8fdde
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -138,7 +138,9 @@ func (h *httpAPI) Query(ctx context.Context, query string, ts time.Time) (model.
q := u.Query() q := u.Query()
q.Set("query", query) q.Set("query", query)
q.Set("time", ts.Format(time.RFC3339Nano)) if !ts.IsZero() {
q.Set("time", ts.Format(time.RFC3339Nano))
}
u.RawQuery = q.Encode() u.RawQuery = q.Encode()