Skip to content

Commit f3ef9f7

Browse files
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent f9231bf commit f3ef9f7

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

cmd/network.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,13 @@ func detectSignatureAlgorithm(r *Request) (string, error) {
374374
continue
375375
}
376376

377-
body, _ := ioutil.ReadAll(response.Body)
377+
defer response.Body.Close()
378+
body, readErr := ioutil.ReadAll(response.Body)
379+
if readErr != nil {
380+
config.Debug("API signature algorithm probe failed reading response body for ", algorithm, ": ", readErr)
381+
lastErr = readErr
382+
continue
383+
}
378384
config.Debug("Signature algorithm probe response body:", string(body))
379385
if _, err := parseAPIResponse(body); err == nil {
380386
config.Debug("Selected API signature algorithm:", algorithm)

0 commit comments

Comments
 (0)