diff options
| author | chrislu <chris.lu@gmail.com> | 2022-08-31 00:09:32 -0700 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2022-08-31 00:09:32 -0700 |
| commit | 9c944377dc8256f33f2c5634c1183cadc5cb5063 (patch) | |
| tree | 16009660ff0b3bab74a9fa5ad3b13c9c949e77b7 /weed/util/http_util.go | |
| parent | a54f30b6c615570fe95323990f9dedca84a29c57 (diff) | |
| download | seaweedfs-9c944377dc8256f33f2c5634c1183cadc5cb5063.tar.xz seaweedfs-9c944377dc8256f33f2c5634c1183cadc5cb5063.zip | |
minor
Diffstat (limited to 'weed/util/http_util.go')
| -rw-r--r-- | weed/util/http_util.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/weed/util/http_util.go b/weed/util/http_util.go index 883dffe60..748bb6e87 100644 --- a/weed/util/http_util.go +++ b/weed/util/http_util.go @@ -60,7 +60,7 @@ func Get(url string) ([]byte, bool, error) { if err != nil { return nil, true, err } - defer response.Body.Close() + defer CloseResponse(response) var reader io.ReadCloser switch response.Header.Get("Content-Encoding") { @@ -242,8 +242,8 @@ func ReadUrl(fileUrl string, cipherKey []byte, isContentCompressed bool, isFullC if err != nil { return 0, err } + defer CloseResponse(r) - defer r.Body.Close() if r.StatusCode >= 400 { return 0, fmt.Errorf("%s: %s", fileUrl, r.Status) } |
