From 7436d9f93710c1a17a904aa3c354d7aa81713ab0 Mon Sep 17 00:00:00 2001 From: Mauve Signweaver Date: Mon, 9 Jan 2023 22:17:38 -0500 Subject: [PATCH] fix: Allow reading rawLeaves in MFS --- packages/ipfs-core/src/components/files/read.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/ipfs-core/src/components/files/read.js b/packages/ipfs-core/src/components/files/read.js index a66ba0d78c..28b132f12c 100644 --- a/packages/ipfs-core/src/components/files/read.js +++ b/packages/ipfs-core/src/components/files/read.js @@ -39,8 +39,8 @@ export function createRead (context) { const mfsPath = await toMfsPath(context, path, options) const result = await exporter(mfsPath.mfsPath, context.repo.blocks) - if (result.type !== 'file') { - throw errCode(new Error(`${path} was not a file`), 'ERR_NOT_FILE') + if (result.type !== 'file' && result.type !== 'raw') { + throw errCode(new Error(`${path} was not a file or raw bytes`), 'ERR_NOT_FILE') } if (!result.content) {