From 5e555efdc825c38043f603dee26c33d54e1c8a6e Mon Sep 17 00:00:00 2001 From: Alan Shaw Date: Sat, 15 Dec 2018 22:01:22 +0000 Subject: [PATCH] test: tests and fixes for CID version agnostic read and write (#1757) * fix: CID parsing for cat/get/ls in HTTP API License: MIT Signed-off-by: Alan Shaw * fix: disable just the rule we're breaking License: MIT Signed-off-by: Alan Shaw Co-Authored-By: alanshaw --- package.json | 2 +- src/http/api/resources/files-regular.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 9673d77075..d1f51beaab 100644 --- a/package.json +++ b/package.json @@ -114,7 +114,7 @@ "ipfs-multipart": "~0.1.0", "ipfs-repo": "~0.26.0", "ipfs-unixfs": "~0.1.16", - "ipfs-unixfs-engine": "~0.35.2", + "ipfs-unixfs-engine": "~0.35.3", "ipld": "~0.20.1", "ipld-bitcoin": "~0.1.8", "ipld-dag-pb": "~0.15.0", diff --git a/src/http/api/resources/files-regular.js b/src/http/api/resources/files-regular.js index c8fae5112f..cbbf91a5f0 100644 --- a/src/http/api/resources/files-regular.js +++ b/src/http/api/resources/files-regular.js @@ -1,6 +1,6 @@ 'use strict' -const mh = require('multihashes') +const CID = require('cids') const multipart = require('ipfs-multipart') const debug = require('debug') const tar = require('tar-stream') @@ -51,7 +51,7 @@ exports.parseKey = (request, reply) => { } try { - mh.fromB58String(key) + new CID(key) // eslint-disable-line no-new } catch (err) { log.error(err) return reply({