We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 28c9ff1 + 8582d80 commit 68a4deeCopy full SHA for 68a4dee
src/compiler/core.ts
@@ -459,8 +459,18 @@ module ts {
459
if (path.charCodeAt(2) === CharacterCodes.slash) return 3;
460
return 2;
461
}
462
+ // Per RFC 1738 'file' URI schema has the shape file://<host>/<path>
463
+ // if <host> is omitted then it is assumed that host value is 'localhost',
464
+ // however slash after the omitted <host> is not removed.
465
+ // file:///folder1/file1 - this is a correct URI
466
+ // file://folder2/file2 - this is an incorrect URI
467
+ if (path.lastIndexOf("file:///", 0) === 0) {
468
+ return "file:///".length;
469
+ }
470
let idx = path.indexOf('://');
- if (idx !== -1) return idx + 3
471
+ if (idx !== -1) {
472
+ return idx + "://".length;
473
474
return 0;
475
476
0 commit comments