From 7dc5c5f349716854dc4c1d3543fb622e4203c318 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Sat, 7 Aug 2021 11:04:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dutils.DumpResponse()=E5=8F=AF?= =?UTF-8?q?=E8=83=BD=E4=BC=9A=E5=BF=BD=E7=95=A5err=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/utils/http.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/utils/http.go b/internal/utils/http.go index fea8d875..de26d231 100644 --- a/internal/utils/http.go +++ b/internal/utils/http.go @@ -16,6 +16,9 @@ var timeoutClientLocker = sync.Mutex{} // DumpResponse 导出响应 func DumpResponse(resp *http.Response) (header []byte, body []byte, err error) { header, err = httputil.DumpResponse(resp, false) + if err != nil { + return + } body, err = ioutil.ReadAll(resp.Body) return }