From 96aeeaf0d1d21a2c801db5b59f472f06dc96c942 Mon Sep 17 00:00:00 2001 From: "Michael Bradley, Jr" Date: Sun, 15 Jul 2018 12:43:00 -0500 Subject: [PATCH] buildUrlFromConfig -- canonicalHost --- lib/utils/utils.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/utils/utils.js b/lib/utils/utils.js index 785c3c19d..85ae481cd 100644 --- a/lib/utils/utils.js +++ b/lib/utils/utils.js @@ -1,5 +1,6 @@ let http = require('follow-redirects').http; let https = require('follow-redirects').https; +const {canonicalHost} = require('./host'); function joinPath() { const path = require('path'); @@ -314,7 +315,7 @@ function buildUrl (protocol, host, port){ function buildUrlFromConfig (configObj){ if(!configObj) throw new Error('[utils.buildUrlFromConfig]: config object must cannot be null'); if(!configObj.host) throw new Error('[utils.buildUrlFromConfig]: object must contain a \'host\' property'); - return this.buildUrl(configObj.protocol, configObj.host, configObj.port); + return this.buildUrl(configObj.protocol, canonicalHost(configObj.host), configObj.port); } function compact(array) {