diff options
author | Nayeem Rahman <nayeemrmn99@gmail.com> | 2020-08-21 14:37:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-21 15:37:06 +0200 |
commit | cf603be24cdc92b6758c602c005f37f4d5f6c5b6 (patch) | |
tree | 4e0d0212a44ad8af3a777cebf65bf266e5c06523 /std/path/win32.ts | |
parent | fd83df7cdb983030ba111a1e19ad6c9ef5eb6128 (diff) |
fix: Allow isolated "%"s when parsing file URLs (#7108)
Diffstat (limited to 'std/path/win32.ts')
-rw-r--r-- | std/path/win32.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/std/path/win32.ts b/std/path/win32.ts index eed1cbdb8..19b29a6b9 100644 --- a/std/path/win32.ts +++ b/std/path/win32.ts @@ -919,7 +919,8 @@ export function fromFileUrl(url: string | URL): string { let path = decodeURIComponent( url.pathname .replace(/^\/*([A-Za-z]:)(\/|$)/, "$1/") - .replace(/\//g, "\\"), + .replace(/\//g, "\\") + .replace(/%(?![0-9A-Fa-f]{2})/g, "%25"), ); if (url.hostname != "") { // Note: The `URL` implementation guarantees that the drive letter and |