Skip to content

Commit

Permalink
fix the sum of header Range
Browse files Browse the repository at this point in the history
  • Loading branch information
zyxkad committed Jan 26, 2024
1 parent ffa16e8 commit 037e700
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -410,9 +410,12 @@ func (cr *Cluster) handleDownloadOSS(rw http.ResponseWriter, req *http.Request,
rg := req.Header.Get("Range")
rgs, err := gosrc.ParseRange(rg, size)
if err == nil && len(rgs) > 0 {
size = 0
newSize := 0
for _, r := range rgs {
size += r.Length
newSize += r.Length

Check failure on line 415 in handler.go

View workflow job for this annotation

GitHub Actions / build

invalid operation: newSize += r.Length (mismatched types int and int64)
}
if newSize < size {

Check failure on line 417 in handler.go

View workflow job for this annotation

GitHub Actions / build

invalid operation: newSize < size (mismatched types int and int64)
size = newSize

Check failure on line 418 in handler.go

View workflow job for this annotation

GitHub Actions / build

cannot use newSize (variable of type int) as int64 value in assignment
}
}
}
Expand Down

0 comments on commit 037e700

Please sign in to comment.