From f79a0dd4488abe37b53a95865f9b56c60869dde0 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Fri, 1 Mar 2024 22:46:42 -0500 Subject: [PATCH] fix: need to use hashBytes and an optional type --- api/s5/s5.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/api/s5/s5.go b/api/s5/s5.go index e958ccd..ae11643 100644 --- a/api/s5/s5.go +++ b/api/s5/s5.go @@ -1657,6 +1657,7 @@ func (s *S5API) downloadFile(jc jape.Context) { } var hashBytes []byte + var typ types.CIDType isProof := false if strings.HasSuffix(cid, storage.PROOF_EXTENSION) { @@ -1676,11 +1677,12 @@ func (s *S5API) downloadFile(jc jape.Context) { hashBytes = hashDecoded.HashBytes() } else { hashBytes = cidDecoded.Hash.HashBytes() + typ = cidDecoded.Type } file := s.newFile(FileParams{ - Hash: cidDecoded.Hash.HashBytes(), - Type: cidDecoded.Type, + Hash: hashBytes, + Type: typ, }) if !file.Exists() {