diff --git a/internal/api/fileserver/servefile.go b/internal/api/fileserver/servefile.go index 5fe79f1d7..8fb5a838e 100644 --- a/internal/api/fileserver/servefile.go +++ b/internal/api/fileserver/servefile.go @@ -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