Skip to content

Commit

Permalink
bootstrap - handle UNC paths correctly (#66128)
Browse files Browse the repository at this point in the history
fixes #53857
  • Loading branch information
the-ress authored and bpasero committed Jan 7, 2019
1 parent d813a31 commit e9d6a65
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit e9d6a65

Please sign in to comment.