1
0
mirror of https://github.com/containers/skopeo.git synced 2025-05-03 05:26:32 +00:00

Close a HTTP response body

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
Miloslav Trmač 2022-10-27 08:00:52 +02:00
parent 5a8d72635c
commit fe5c4091ee

View File

@ -116,6 +116,7 @@ func (t *testRegistryV2) Ping() error {
if err != nil { if err != nil {
return err return err
} }
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusUnauthorized { if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusUnauthorized {
return fmt.Errorf("registry ping replied with an unexpected status code %d", resp.StatusCode) return fmt.Errorf("registry ping replied with an unexpected status code %d", resp.StatusCode)
} }