Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
diff --git a/cmd/network.go b/cmd/network.go
index 213d2fd..b5a0885 100644
--- a/cmd/network.go
+++ b/cmd/network.go
@@ -540,7 +540,12 @@
}
func processAPIResponse(r *Request, response *http.Response, isAsync bool) (map[string]interface{}, error) {
- body, _ := ioutil.ReadAll(response.Body)
+ defer response.Body.Close()
+
+ body, readErr := ioutil.ReadAll(response.Body)
+ if readErr != nil {
+ return nil, readErr
+ }
config.Debug("NewAPIRequest response body:", string(body))
apiResponse, err := parseAPIResponse(body)