fix: use CIDFromHash

This commit is contained in:
Derrick Hammer 2024-01-15 14:41:24 -05:00
parent 699869ca3e
commit 0cd60b7db0
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 2 additions and 1 deletions

View File

@ -5,6 +5,7 @@ import (
"errors"
"git.lumeweb.com/LumeWeb/libs5-go/encoding"
s5interface "git.lumeweb.com/LumeWeb/libs5-go/interfaces"
"git.lumeweb.com/LumeWeb/libs5-go/types"
"git.lumeweb.com/LumeWeb/portal/interfaces"
"go.sia.tech/jape"
"go.uber.org/zap"
@ -97,7 +98,7 @@ func (h *HttpHandlerImpl) SmallFileUpload(jc *jape.Context) {
return
}
cid, err := encoding.CIDFromBytes(hash)
cid, err := encoding.CIDFromHash(hash, uint64(len(buffer.Bytes())), types.CIDTypeRaw)
if err != nil {
_ = jc.Error(errUploadingFileErr, http.StatusInternalServerError)