fix: need to seek to reset reader

This commit is contained in:
Derrick Hammer 2024-01-17 11:04:24 -05:00
parent bccd919872
commit 708bd82879
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 6 additions and 0 deletions

View File

@ -118,6 +118,12 @@ func (h *HttpHandler) SmallFileUpload(jc jape.Context) {
} }
hash, err := h.portal.Storage().GetHash(rs) 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 { if err != nil {
_ = jc.Error(errUploadingFileErr, http.StatusInternalServerError) _ = jc.Error(errUploadingFileErr, http.StatusInternalServerError)