From 2c3b35270bcb78cf0a30593d9310b96aea588045 Mon Sep 17 00:00:00 2001 From: Kiran Niranjan Date: Sat, 30 Dec 2017 12:49:39 +0530 Subject: [PATCH] Electron-156 Updated the code not to encode the URL and just validate the protocol --- js/main.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/js/main.js b/js/main.js index 8d3184de..8a93340a 100644 --- a/js/main.js +++ b/js/main.js @@ -291,17 +291,14 @@ function getUrlAndCreateMainWindow() { * @param urlFromConfig */ function createWin(urlFromConfig) { - let protocol = ''; // add https protocol if none found. let parsedUrl = nodeURL.parse(urlFromConfig); + if (!parsedUrl.protocol) { - protocol = 'https'; + parsedUrl.protocol = 'https:'; + parsedUrl.slashes = true } - let url = nodeURL.format({ - protocol: protocol, - slahes: true, - pathname: parsedUrl.href - }); + let url = nodeURL.format(parsedUrl); windowMgr.createMainWindow(url); }