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

This commit is contained in:
刘祥超
2021-08-07 11:04:03 +08:00
parent 566c04f080
commit 7dc5c5f349

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
}