mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-01 16:12:25 -05:00
[bugfix] fix file range length calculation being off by 1 (#1448)
* small formatting change * fix range handling new length calculation --------- Signed-off-by: kim <grufwub@gmail.com>
This commit is contained in:
parent
6a6647d68b
commit
ac2bdbbc62
2 changed files with 5 additions and 6 deletions
|
|
@ -218,8 +218,9 @@ func serveFileRange(rw http.ResponseWriter, src io.Reader, rng string, size int6
|
|||
return
|
||||
}
|
||||
|
||||
// Determine content len
|
||||
length := end - start
|
||||
// Determine new content length
|
||||
// after slicing to given range.
|
||||
length := end - start + 1
|
||||
|
||||
if end < size-1 {
|
||||
// Range end < file end, limit the reader
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue