修复utils.DumpResponse()可能会忽略err的问题

This commit is contained in:
GoEdgeLab
2021-08-07 11:04:03 +08:00
parent bbfa04fa7f
commit 80a309fb9b

View File

@@ -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
}