From b60b71cec53642110efddea4687e3a58ffdb2fab Mon Sep 17 00:00:00 2001 From: Rutger Broekhoff Date: Tue, 2 Jan 2024 17:23:17 +0100 Subject: Write Content-Length in object GET --- cmd/git-lfs-server/main.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/git-lfs-server/main.go b/cmd/git-lfs-server/main.go index c7feeff..0652e87 100644 --- a/cmd/git-lfs-server/main.go +++ b/cmd/git-lfs-server/main.go @@ -490,6 +490,9 @@ func (h *handler) handleGetObject(w http.ResponseWriter, r *http.Request, repo, makeRespError(ctx, w, "Internal server error", http.StatusInternalServerError) } + w.Header().Set("Content-Length", strconv.FormatInt(claims.Gitolfs3.Size, 10)) + w.WriteHeader(http.StatusOK) + vr := newValidatingReader(claims.Gitolfs3.Size, sha256Raw, obj) _, err = io.Copy(w, vr) if errors.Is(err, errBadSum) { -- cgit v1.2.3