aboutsummaryrefslogtreecommitdiff
path: root/weed/operation/chunked_file.go
diff options
context:
space:
mode:
Diffstat (limited to 'weed/operation/chunked_file.go')
-rw-r--r--weed/operation/chunked_file.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/weed/operation/chunked_file.go b/weed/operation/chunked_file.go
index f3f6e7b00..995f06b53 100644
--- a/weed/operation/chunked_file.go
+++ b/weed/operation/chunked_file.go
@@ -6,6 +6,7 @@ import (
"fmt"
"google.golang.org/grpc"
"io"
+ "io/ioutil"
"net/http"
"sort"
@@ -103,7 +104,10 @@ func readChunkNeedle(fileUrl string, w io.Writer, offset int64) (written int64,
if err != nil {
return written, err
}
- defer resp.Body.Close()
+ defer func() {
+ io.Copy(ioutil.Discard, resp.Body)
+ resp.Body.Close()
+ }()
switch resp.StatusCode {
case http.StatusRequestedRangeNotSatisfiable: