From c5398c4b868c0f50a26d2e0e91897b00be9d37e6 Mon Sep 17 00:00:00 2001 From: Rafael Taranto Date: Mon, 15 Jul 2019 21:14:41 +0100 Subject: [PATCH] Assume https:// at the start of infura endpoint --- lib/plugins/wallet/infura/infura.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/plugins/wallet/infura/infura.js b/lib/plugins/wallet/infura/infura.js index fe550612..8cff40b4 100644 --- a/lib/plugins/wallet/infura/infura.js +++ b/lib/plugins/wallet/infura/infura.js @@ -2,8 +2,10 @@ const _ = require('lodash/fp') const base = require('../geth/base') function run (account) { - const endpoint = account.endpoint - if (!endpoint) throw new Error('Need to configure API endpoint for Infura') + if (!account.endpoint) throw new Error('Need to configure API endpoint for Infura') + + const endpoint = _.startsWith('https://')(account.endpoint) + ? account.endpoint : `https://${account.endpoint}` base.connect(endpoint) }