From 708bd82879573656e2aa99adff8637d37fb07f87 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Wed, 17 Jan 2024 11:04:24 -0500 Subject: [PATCH] fix: need to seek to reset reader --- api/s5/http.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/api/s5/http.go b/api/s5/http.go index 09d6d9b..8c0950b 100644 --- a/api/s5/http.go +++ b/api/s5/http.go @@ -118,6 +118,12 @@ func (h *HttpHandler) SmallFileUpload(jc jape.Context) { } hash, err := h.portal.Storage().GetHash(rs) + _, err = rs.Seek(0, io.SeekStart) + if err != nil { + _ = jc.Error(errUploadingFileErr, http.StatusInternalServerError) + h.portal.Logger().Error(errUploadingFile, zap.Error(err)) + return + } if err != nil { _ = jc.Error(errUploadingFileErr, http.StatusInternalServerError)