From a2689699902faf48119ea835d0764cc02a8d05b0 Mon Sep 17 00:00:00 2001 From: Nejc Zdovc Date: Wed, 18 Apr 2018 08:41:47 +0200 Subject: [PATCH] Merge pull request #13722 from NejcZdovc/fix/#12826-url Fixes invalid url error --- js/lib/request.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/lib/request.js b/js/lib/request.js index af5cfba1cbc..019f2d20366 100644 --- a/js/lib/request.js +++ b/js/lib/request.js @@ -49,6 +49,10 @@ module.exports.request = (options, callback) => { }) } + if (typeof options.url !== 'string') { + return callback(new Error('URL is not valid')) + } + if (process.env.NODE_ENV === 'development' && urlParse(options.url).protocol === 'http:') { console.log('WARNING: requesting non-HTTPS URL', options.url)