]> source.dussan.org Git - gitea.git/commitdiff
Fix LFS not returning correct content length when requesting a range of bytes (#2864)
authorJacob Parry <jacob@jacobparry.ca>
Tue, 7 Nov 2017 04:33:04 +0000 (23:33 -0500)
committerLauris BH <lauris@nix.lv>
Tue, 7 Nov 2017 04:33:04 +0000 (06:33 +0200)
modules/lfs/server.go

index 1a15aba0014b6e8559d5339a6d2975b6d854bbff..d618d6185318546c6f59cfbbbdfac3e789acf398 100644 (file)
@@ -152,7 +152,7 @@ func getContentHandler(ctx *context.Context) {
                return
        }
 
-       ctx.Resp.Header().Set("Content-Length", strconv.FormatInt(meta.Size, 10))
+       ctx.Resp.Header().Set("Content-Length", strconv.FormatInt(meta.Size-fromByte, 10))
        ctx.Resp.Header().Set("Content-Type", "application/octet-stream")
 
        filename := ctx.Params("filename")