diff options
Diffstat (limited to 'std/http/file_server.ts')
-rw-r--r-- | std/http/file_server.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/std/http/file_server.ts b/std/http/file_server.ts index e4c8c4931..b75f9f9c1 100644 --- a/std/http/file_server.ts +++ b/std/http/file_server.ts @@ -322,14 +322,15 @@ function html(strings: TemplateStringsArray, ...values: unknown[]): string { } function normalizeURL(url: string): string { - let normalizedUrl = posix.normalize(url); + let normalizedUrl = url; try { - normalizedUrl = decodeURIComponent(normalizedUrl); + normalizedUrl = decodeURI(normalizedUrl); } catch (e) { if (!(e instanceof URIError)) { throw e; } } + normalizedUrl = posix.normalize(normalizedUrl); const startOfParams = normalizedUrl.indexOf("?"); return startOfParams > -1 ? normalizedUrl.slice(0, startOfParams) |