diff --git a/package.json b/package.json index 68ff78cf34..079471ea08 100644 --- a/package.json +++ b/package.json @@ -141,7 +141,7 @@ "mime-types": "^2.1.21", "mkdirp": "~0.5.1", "multiaddr": "^6.1.0", - "multiaddr-to-uri": "^4.0.1", + "multiaddr-to-uri": "^5.0.0", "multibase": "~0.6.0", "multicodec": "~0.5.5", "multihashes": "~0.4.14", diff --git a/src/core/preload.js b/src/core/preload.js index 983b0445d1..605e3350dc 100644 --- a/src/core/preload.js +++ b/src/core/preload.js @@ -32,7 +32,7 @@ module.exports = self => { let stopped = true let requests = [] - const apiUris = options.addresses.map(apiAddrToUri) + const apiUris = options.addresses.map(toUri) const api = (cid, callback) => { callback = callback || noop @@ -84,10 +84,3 @@ module.exports = self => { return api } - -function apiAddrToUri (addr) { - if (!(addr.endsWith('http') || addr.endsWith('https'))) { - addr = addr + '/http' - } - return toUri(addr) -}