Skip to content

Commit 6d482cf

Browse files
buildUrlFromConfig -- canonicalHost
1 parent 0191ec9 commit 6d482cf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/utils/utils.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
let http = require('follow-redirects').http;
22
let https = require('follow-redirects').https;
3+
const {canonicalHost} = require('./host');
34

45
const balanceRegex = /([0-9]+) ?([a-zA-Z]*)/;
56

@@ -296,7 +297,7 @@ function buildUrl (protocol, host, port){
296297
function buildUrlFromConfig (configObj){
297298
if(!configObj) throw new Error('[utils.buildUrlFromConfig]: config object must cannot be null');
298299
if(!configObj.host) throw new Error('[utils.buildUrlFromConfig]: object must contain a \'host\' property');
299-
return this.buildUrl(configObj.protocol, configObj.host, configObj.port);
300+
return this.buildUrl(configObj.protocol, canonicalHost(configObj.host), configObj.port);
300301
}
301302

302303
function getWeiBalanceFromString(balanceString, web3){

0 commit comments

Comments
 (0)