fix(unsplash): close pingback response body

The pingback discarded the response, leaking the body and its
connection on every pingback.
This commit is contained in:
kolaente
2026-10-19 14:50:05 +02:00
parent 812520d4de
commit 12ed4036c8
+4 -1
View File
@@ -380,9 +380,12 @@ func pingbackByPhotoID(photoID string) {
if err != nil {
log.Errorf("Unsplash Pingback Failed: %s", err.Error())
}
_, err = utils.NewSSRFSafeHTTPClient().Do(req) //nolint:gosec // SSRF protection is handled by the SSRF-safe client
resp, err := utils.NewSSRFSafeHTTPClient().Do(req) //nolint:gosec // SSRF protection is handled by the SSRF-safe client
if err != nil {
log.Errorf("Unsplash Pingback Failed: %s", err.Error())
} else {
_, _ = io.Copy(io.Discard, resp.Body)
_ = resp.Body.Close()
}
log.Debugf("Pinged unsplash for photo %s", photoID)
}