Skip to content

Commit

Permalink
fix: support HTTPS API endpoints (#654)
Browse files Browse the repository at this point in the history
This commit fixes the issue that a protocol name (http or https) is not passed to `ipfs-http-client` as intended.

Closes #652
  • Loading branch information
yvt authored and lidel committed Jan 8, 2019
1 parent 5ea62ee commit 8bb8a62
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion add-on/src/lib/ipfs-client/external.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ exports.init = async function (opts) {
console.log('[ipfs-companion] External ipfs init', opts.apiURLString)

const url = opts.apiURL
const api = IpfsApi({ host: url.hostname, port: url.port, procotol: url.protocol })
const protocol = url.protocol.substr(0, url.protocol.length - 1) // http: -> http
const api = IpfsApi({ host: url.hostname, port: url.port, protocol })
return api
}

Expand Down

0 comments on commit 8bb8a62

Please sign in to comment.