diff options
Diffstat (limited to 'std/http/file_server_test.ts')
-rw-r--r-- | std/http/file_server_test.ts | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/std/http/file_server_test.ts b/std/http/file_server_test.ts index ba625b7c8..0329168e7 100644 --- a/std/http/file_server_test.ts +++ b/std/http/file_server_test.ts @@ -83,12 +83,15 @@ test(async function serveFallback(): Promise<void> { } }); -test(async function serveFallback(): Promise<void> { +test(async function serveWithUnorthodoxFilename(): Promise<void> { await startFileServer(); try { - const res = await fetch( - "http://localhost:4500/http/testdata/test%20file.txt" - ); + let res = await fetch("http://localhost:4500/http/testdata/%"); + assert(res.headers.has("access-control-allow-origin")); + assert(res.headers.has("access-control-allow-headers")); + assertEquals(res.status, 200); + + res = await fetch("http://localhost:4500/http/testdata/test%20file.txt"); assert(res.headers.has("access-control-allow-origin")); assert(res.headers.has("access-control-allow-headers")); assertEquals(res.status, 200); |