aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan <me@jordan.im>2024-01-24 01:16:56 -0700
committerJordan <me@jordan.im>2024-01-24 01:16:56 -0700
commitfb07310bf45744f1eae582ce2546ed2dfcf50259 (patch)
tree149c1f385d1b186dd00b7014e763b8d14e876a22
parent22a894c813bab20665ed5830e253d967aefb2e8b (diff)
downloadpipkin-fb07310bf45744f1eae582ce2546ed2dfcf50259.tar.gz
pipkin-fb07310bf45744f1eae582ce2546ed2dfcf50259.zip
client: defer closure of S3 request response body
-rw-r--r--pipkin.go1
1 files changed, 1 insertions, 0 deletions
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)