mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2024-12-22 10:12:11 +00:00
[bugfix] Correctly handle range > content-length (#2395)
This commit is contained in:
parent
2eb8b8eeb4
commit
2cc264584e
|
@ -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