aboutsummaryrefslogtreecommitdiff
path: root/weed/s3api/s3api_object_handlers.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-02-14 09:46:36 -0800
committerChris Lu <chris.lu@gmail.com>2020-02-14 09:46:36 -0800
commit96c1ae84719e934231e0a81c89917d1190be5e39 (patch)
treee2157e651de64141a810a9603cdedfdafe2eacad /weed/s3api/s3api_object_handlers.go
parentcf5064d7025c6b74ac721b8914a76d5f1d155836 (diff)
downloadseaweedfs-96c1ae84719e934231e0a81c89917d1190be5e39.tar.xz
seaweedfs-96c1ae84719e934231e0a81c89917d1190be5e39.zip
refactoring the close http response
Diffstat (limited to 'weed/s3api/s3api_object_handlers.go')
-rw-r--r--weed/s3api/s3api_object_handlers.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/weed/s3api/s3api_object_handlers.go b/weed/s3api/s3api_object_handlers.go
index b8df86aee..1f1c181ec 100644
--- a/weed/s3api/s3api_object_handlers.go
+++ b/weed/s3api/s3api_object_handlers.go
@@ -13,6 +13,7 @@ import (
"github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/server"
+ "github.com/chrislusf/seaweedfs/weed/util"
)
var (
@@ -145,9 +146,10 @@ func (s3a *S3ApiServer) proxyToFiler(w http.ResponseWriter, r *http.Request, des
writeErrorResponse(w, ErrInternalError, r.URL)
return
}
- defer resp.Body.Close()
+ defer util.CloseResponse(resp)
responseFn(resp, w)
+
}
func passThroughResponse(proxyResonse *http.Response, w http.ResponseWriter) {
for k, v := range proxyResonse.Header {