From 6b8e3122f802cf94fa85ba0fb221b339434068a7 Mon Sep 17 00:00:00 2001 From: Marcus Efraimsson Date: Tue, 26 Mar 2019 12:10:24 +0700 Subject: [PATCH] chore(influx): no point of reading response when bad status (#16212) There's no point in reading the body response without using the result so removing it. Fixes #9199 Ref #16207 --- pkg/tsdb/influxdb/influxdb.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkg/tsdb/influxdb/influxdb.go b/pkg/tsdb/influxdb/influxdb.go index 3ee6b8a30d6..3502f1ac196 100644 --- a/pkg/tsdb/influxdb/influxdb.go +++ b/pkg/tsdb/influxdb/influxdb.go @@ -4,7 +4,6 @@ import ( "context" "encoding/json" "fmt" - "io/ioutil" "net/http" "net/url" "path" @@ -73,7 +72,6 @@ func (e *InfluxDBExecutor) Query(ctx context.Context, dsInfo *models.DataSource, defer resp.Body.Close() if resp.StatusCode/100 != 2 { - ioutil.ReadAll(resp.Body) return nil, fmt.Errorf("Influxdb returned statuscode invalid status code: %v", resp.Status) }