Skip to content

Commit

Permalink
If len is zero, return error
Browse files Browse the repository at this point in the history
  • Loading branch information
gagliardetto committed Aug 16, 2023
1 parent f3c5ddb commit 0f60ba9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions http-range.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ func remoteHTTPFileAsIoReaderAt(ctx context.Context, url string) (ReaderAtCloser
if err != nil {
return nil, err
}
if contentLength == 0 {
return nil, fmt.Errorf("missing Content-Length/Content-Range header, or file is empty")
}

// Create a cache with a default expiration time of 5 minutes, and which
// purges expired items every 10 minutes
Expand Down

0 comments on commit 0f60ba9

Please sign in to comment.