diff --git a/weed/util/http_util.go b/weed/util/http_util.go index 92681d8e8..00dac26f7 100644 --- a/weed/util/http_util.go +++ b/weed/util/http_util.go @@ -331,7 +331,9 @@ func ReadUrlAsStream(fileUrl string, cipherKey []byte, isContentGzipped bool, is for { m, err = reader.Read(buf) - fn(buf[:m]) + if m > 0 { + fn(buf[:m]) + } if err == io.EOF { return false, nil }