chore: fix a couple of unclosed http connections (#10806)

Signed-off-by: Jakob Borg <jakob@kastelo.net>
This commit is contained in:
Jakob Borg
2026-07-20 20:22:40 +00:00
committed by GitHub
parent 578cc5a165
commit d710874903
2 changed files with 3 additions and 2 deletions
+2
View File
@@ -407,6 +407,7 @@ func (c *idCheckingHTTPClient) Get(ctx context.Context, url string) (*http.Respo
return nil, err
}
if err := c.check(resp); err != nil {
resp.Body.Close()
return nil, err
}
@@ -419,6 +420,7 @@ func (c *idCheckingHTTPClient) Post(ctx context.Context, url, ctype string, data
return nil, err
}
if err := c.check(resp); err != nil {
resp.Body.Close()
return nil, err
}
+1 -2
View File
@@ -607,6 +607,7 @@ func soapRequestWithIP(ctx context.Context, url, service, function, message stri
l.Debugln("SOAP do:", err)
return resp, err
}
defer r.Body.Close()
resp, err = io.ReadAll(r.Body)
if err != nil {
@@ -616,8 +617,6 @@ func soapRequestWithIP(ctx context.Context, url, service, function, message stri
l.Debugf("SOAP Response: %s\n\n%s\n\n", r.Status, resp)
r.Body.Close()
if r.StatusCode >= 400 {
return resp, errors.New(function + ": " + r.Status)
}