1
1
mirror of https://github.com/go-gitea/gitea synced 2025-08-05 17:18:21 +00:00

Fix SSH LFS memory usage (#33455) (#33460)

Backport #33455 by wxiaoguang

Fix #33448

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
Giteabot
2025-01-31 19:30:16 +08:00
committed by GitHub
parent 159544a950
commit 7df1204795
13 changed files with 77 additions and 103 deletions

View File

@@ -134,7 +134,9 @@ func DownloadHandler(ctx *context.Context) {
}
contentLength := toByte + 1 - fromByte
ctx.Resp.Header().Set("Content-Length", strconv.FormatInt(contentLength, 10))
contentLengthStr := strconv.FormatInt(contentLength, 10)
ctx.Resp.Header().Set("Content-Length", contentLengthStr)
ctx.Resp.Header().Set("X-Gitea-LFS-Content-Length", contentLengthStr) // we need this header to make sure it won't be affected by reverse proxy or compression
ctx.Resp.Header().Set("Content-Type", "application/octet-stream")
filename := ctx.PathParam("filename")