From fb07310bf45744f1eae582ce2546ed2dfcf50259 Mon Sep 17 00:00:00 2001 From: Jordan Date: Wed, 24 Jan 2024 01:16:56 -0700 Subject: client: defer closure of S3 request response body --- pipkin.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pipkin.go b/pipkin.go index 8996f56..f8896ce 100644 --- a/pipkin.go +++ b/pipkin.go @@ -177,6 +177,7 @@ func (pk *Pipkin) fetch(w http.ResponseWriter, r *http.Request) { http.Error(w, http.StatusText(http.StatusNotFound), http.StatusNotFound) return } + defer resp.Body.Close() statusOK := resp.StatusCode >= 200 && resp.StatusCode < 400 pk.log.Infof("%s %d %s %s %s\n", r.Method, resp.StatusCode, hostStr, host.Bucket, key) -- cgit v1.2.3-54-g00ecf