diff options
author | Rutger Broekhoff | 2024-01-02 17:23:17 +0100 |
---|---|---|
committer | Rutger Broekhoff | 2024-01-02 17:23:17 +0100 |
commit | b60b71cec53642110efddea4687e3a58ffdb2fab (patch) | |
tree | f39116d137590b660a750327a26a0fb196aa153d /cmd | |
parent | 6e97a3edaa18ef8e5b16feba29f04e993957b7a7 (diff) | |
download | gitolfs3-b60b71cec53642110efddea4687e3a58ffdb2fab.tar.gz gitolfs3-b60b71cec53642110efddea4687e3a58ffdb2fab.zip |
Write Content-Length in object GET
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/git-lfs-server/main.go | 3 |
1 files changed, 3 insertions, 0 deletions
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, | |||
490 | makeRespError(ctx, w, "Internal server error", http.StatusInternalServerError) | 490 | makeRespError(ctx, w, "Internal server error", http.StatusInternalServerError) |
491 | } | 491 | } |
492 | 492 | ||
493 | w.Header().Set("Content-Length", strconv.FormatInt(claims.Gitolfs3.Size, 10)) | ||
494 | w.WriteHeader(http.StatusOK) | ||
495 | |||
493 | vr := newValidatingReader(claims.Gitolfs3.Size, sha256Raw, obj) | 496 | vr := newValidatingReader(claims.Gitolfs3.Size, sha256Raw, obj) |
494 | _, err = io.Copy(w, vr) | 497 | _, err = io.Copy(w, vr) |
495 | if errors.Is(err, errBadSum) { | 498 | if errors.Is(err, errBadSum) { |