From 5de1744d7ef48196301a55b5aedd49979dbb4551 Mon Sep 17 00:00:00 2001 From: t_max <1172915550@qq.com> Date: Mon, 26 Feb 2024 09:54:26 +0800 Subject: [PATCH] enh: read response until EOF --- taosRestful/connection.go | 1 + 1 file changed, 1 insertion(+) diff --git a/taosRestful/connection.go b/taosRestful/connection.go index 46331e3..e7f21c5 100644 --- a/taosRestful/connection.go +++ b/taosRestful/connection.go @@ -211,6 +211,7 @@ func (tc *taosConn) taosQuery(ctx context.Context, sql string, bufferSize int) ( return nil, fmt.Errorf("server response: %s - %s", resp.Status, string(body)) } respBody := resp.Body + defer ioutil.ReadAll(respBody) if !tc.cfg.disableCompression && EqualFold(resp.Header.Get("Content-Encoding"), "gzip") { respBody, err = gzip.NewReader(resp.Body) if err != nil {