Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

Commit 302daf8

Browse files
committed
Encode in path2uri
1 parent b665cd8 commit 302daf8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/util.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,9 @@ export function path2uri(rootUri: URL, filePath: string): URL {
9696
for (let i = 1; i < parts.length; i++) {
9797
parts[i] = encodeURIComponent(parts[i]);
9898
}
99-
const pathname = parts.join(isWindowsUri ? '\\' : '/');
100-
return new URL(pathname, rootUri.href);
99+
const uri = new URL(rootUri.href);
100+
uri.pathname = parts.join('/');
101+
return uri;
101102
}
102103

103104
/**

0 commit comments

Comments
 (0)