fix: update use of CIDFromHash

This commit is contained in:
Derrick Hammer 2024-01-17 11:31:48 -05:00
parent da86c96c87
commit 897fec75ad
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 2 additions and 2 deletions

View File

@ -132,7 +132,7 @@ func (h *HttpHandler) SmallFileUpload(jc jape.Context) {
} }
if exists, upload := h.portal.Storage().FileExists(hash); exists { if exists, upload := h.portal.Storage().FileExists(hash); exists {
cid, err := encoding.CIDFromHash(hash, upload.Size, types.CIDTypeRaw) cid, err := encoding.CIDFromHash(hash, upload.Size, types.CIDTypeRaw, types.HashTypeBlake3)
if err != nil { if err != nil {
_ = jc.Error(errUploadingFileErr, http.StatusInternalServerError) _ = jc.Error(errUploadingFileErr, http.StatusInternalServerError)
h.portal.Logger().Error(errUploadingFile, zap.Error(err)) h.portal.Logger().Error(errUploadingFile, zap.Error(err))
@ -156,7 +156,7 @@ func (h *HttpHandler) SmallFileUpload(jc jape.Context) {
return return
} }
cid, err := encoding.CIDFromHash(hash, uint64(bufferSize), types.CIDTypeRaw) cid, err := encoding.CIDFromHash(hash, uint64(bufferSize), types.CIDTypeRaw, types.HashTypeBlake3)
if err != nil { if err != nil {
_ = jc.Error(errUploadingFileErr, http.StatusInternalServerError) _ = jc.Error(errUploadingFileErr, http.StatusInternalServerError)