diff --git a/pluginHandler.js b/pluginHandler.js index 9334aa0b..83f5d194 100644 --- a/pluginHandler.js +++ b/pluginHandler.js @@ -201,9 +201,13 @@ module.exports.pluginHandler = function (parent) { obj.getPluginConfig = function(configUrl) { return new Promise(function(resolve, reject) { - var https = require('https'); + if (configUrl.indexOf('https://') >= 0) { + var http = require('https'); + } else { + var http = require('http'); + } if (configUrl.indexOf('://') === -1) reject('Unable to fetch the config: Bad URL (' + configUrl + ')'); - https.get(configUrl, function(res) { + http.get(configUrl, function(res) { var configStr = ''; res.on('data', function(chunk){ configStr += chunk;