diff options
| author | chrislu <chris.lu@gmail.com> | 2022-08-31 00:24:29 -0700 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2022-08-31 00:24:29 -0700 |
| commit | 3d8b8ffcedaa0b3aa1306153c8e30e5e8525b7ac (patch) | |
| tree | a0276eaadf498589ff3de88d2ed8f37621b0e400 /weed/operation/chunked_file.go | |
| parent | 870a30665b69da95bba304e8d2c4b7affa29896f (diff) | |
| download | seaweedfs-3d8b8ffcedaa0b3aa1306153c8e30e5e8525b7ac.tar.xz seaweedfs-3d8b8ffcedaa0b3aa1306153c8e30e5e8525b7ac.zip | |
refactor
Diffstat (limited to 'weed/operation/chunked_file.go')
| -rw-r--r-- | weed/operation/chunked_file.go | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/weed/operation/chunked_file.go b/weed/operation/chunked_file.go index 790a8012e..eacf64112 100644 --- a/weed/operation/chunked_file.go +++ b/weed/operation/chunked_file.go @@ -106,10 +106,7 @@ func readChunkNeedle(fileUrl string, w io.Writer, offset int64, jwt string) (wri if err != nil { return written, err } - defer func() { - io.Copy(io.Discard, resp.Body) - resp.Body.Close() - }() + defer util.CloseResponse(resp) switch resp.StatusCode { case http.StatusRequestedRangeNotSatisfiable: |
