mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2024-10-31 22:18:52 +00:00
[bugfix] Correctly handle range > content-length (#2395)
This commit is contained in:
parent
2eb8b8eeb4
commit
2cc264584e
1 changed files with 2 additions and 1 deletions
|
@ -206,10 +206,11 @@ func serveFileRange(rw http.ResponseWriter, r *http.Request, src io.Reader, rng
|
|||
return
|
||||
}
|
||||
|
||||
if end > size {
|
||||
if end >= size {
|
||||
// According to the http spec if end >= size the server should return the rest of the file
|
||||
// https://www.rfc-editor.org/rfc/rfc9110#section-14.1.2-6
|
||||
end = size - 1
|
||||
endRng = strconv.FormatInt(end, 10)
|
||||
}
|
||||
} else {
|
||||
// No end supplied, implying file end
|
||||
|
|
Loading…
Reference in a new issue