ELECTRON-397: fix the regression on opening external urls (#332)

This commit is contained in:
Vishwas Shashidhar 2018-04-02 15:51:22 +05:30 committed by GitHub
parent 8cb4382606
commit 2526fdd65c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -77,17 +77,17 @@ function removeWindowKey(key) {
/** /**
* Gets the parsed url * Gets the parsed url
* @returns {String} * @returns {Url}
* @param appUrl * @param appUrl
*/ */
function getParsedUrl(appUrl) { function getParsedUrl(appUrl) {
let parsedUrl = nodeURL.parse(appUrl); let parsedUrl = nodeURL.parse(appUrl);
if (!parsedUrl.protocol || parsedUrl.protocol !== 'https') { if (!parsedUrl.protocol || parsedUrl.protocol !== 'https:') {
parsedUrl.protocol = 'https:'; parsedUrl.protocol = 'https:';
parsedUrl.slashes = true parsedUrl.slashes = true
} }
let url = nodeURL.format(parsedUrl); let url = nodeURL.format(parsedUrl);
return url; return nodeURL.parse(url);
} }
/** /**