refactoring the close http response

This commit is contained in:
Chris Lu
2020-02-14 09:46:36 -08:00
parent cf5064d702
commit 96c1ae8471
2 changed files with 8 additions and 6 deletions

View File

@@ -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 {