From e9d6a653e6886444730a70886bdf94ee61a8c388 Mon Sep 17 00:00:00 2001 From: Tereza Tomcova Date: Mon, 7 Jan 2019 12:51:27 +0100 Subject: [PATCH] bootstrap - handle UNC paths correctly (#66128) fixes #53857 --- src/bootstrap.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/bootstrap.js b/src/bootstrap.js index 5f73a09dc7e..ab57c6dc83c 100644 --- a/src/bootstrap.js +++ b/src/bootstrap.js @@ -69,7 +69,15 @@ exports.uriFromPath = function (_path) { pathName = '/' + pathName; } - return encodeURI('file://' + pathName).replace(/#/g, '%23'); + /** @type {string} */ + let uri; + if (pathName.startsWith('//')) { + uri = encodeURI('file:' + pathName); + } else { + uri = encodeURI('file://' + pathName); + } + + return uri.replace(/#/g, '%23'); }; //#endregion -- GitLab