fix: serve static file with parens (#2013)

This commit is contained in:
Marvin Hagemeister
2023-11-06 09:22:54 +01:00
committed by GitHub
parent 1ba1726e76
commit 4759b21be8
4 changed files with 14 additions and 15 deletions
+1
View File
@@ -0,0 +1 @@
it works
+1
View File
@@ -0,0 +1 @@
it works
+10
View File
@@ -359,6 +359,16 @@ Deno.test("static file - by file path", async () => {
assertEquals(resp3.headers.get("content-type"), "text/plain");
});
Deno.test("static file - spaces or other characters in name", async () => {
const res = await handler(new Request("https://fresh.deno.dev/foo bar.txt"));
assertEquals(await res.text(), "it works");
const res2 = await handler(
new Request("https://fresh.deno.dev/foo (bar).txt"),
);
assertEquals(await res2.text(), "it works");
});
Deno.test("HEAD request", async () => {
// Static file
const resp = await handler(