From 27cbe2d88611a239e8c42cfa652c86048f2011ad Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Wed, 24 Jan 2024 02:00:53 -0500 Subject: [PATCH] fix: wrong hash encoding --- storage/storage.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/storage/storage.go b/storage/storage.go index 3d50d83..a56f8a8 100644 --- a/storage/storage.go +++ b/storage/storage.go @@ -619,7 +619,10 @@ func (s *StorageServiceImpl) GetFile(hash []byte) (io.ReadCloser, uint64, error) return nil, 0, errors.New("file does not exist") } - hashStr := hex.EncodeToString(hash) + hashStr, err := encoding.NewMultihash(s.getPrefixedHash(hash)).ToBase64Url() + if err != nil { + return nil, 0, err + } resp, err := s.httpApi.R(). SetPathParam("path", hashStr).