From 3f8eaa1bf4778ebf9319d3fda9e1c023f14c30df Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Thu, 16 Sep 2021 12:03:43 -0700 Subject: [PATCH] fix: do not pass incoming context for caching --- cache.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cache.go b/cache.go index e55d312..3708133 100644 --- a/cache.go +++ b/cache.go @@ -698,10 +698,11 @@ func cacheHandler(w http.ResponseWriter, r *http.Request, b *Backend) http.Handl pipeReader, pipeWriter := io.Pipe() mw := cacheMultiWriter(w, pipeWriter) go func() { - _, err := clnt.PutObject(r.Context(), clnt.bucket, key, + _, err := clnt.PutObject(context.Background(), clnt.bucket, key, io.LimitReader(pipeReader, resultContentLength), resultContentLength, "", "", minio.PutObjectOptions{ - UserMetadata: getPutMetadata(result.Header), + UserMetadata: getPutMetadata(result.Header), + DisableMultipart: true, }) if err != nil { clnt.setOffline()