diff options
author | uki00a <uki00a@gmail.com> | 2020-10-26 22:55:26 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-26 14:55:26 +0100 |
commit | b65171e37df066cf7c509434c611163fc8a3c720 (patch) | |
tree | 027f3f1f5d6533383f51a4ede047b961c3fc4e80 /std/http/file_server_test.ts | |
parent | 57cad539457dff7fc273bed5ecaf08bd3dc40d1b (diff) |
fix(std/http/file_server): File server should ignore query params (#8116)
Diffstat (limited to 'std/http/file_server_test.ts')
-rw-r--r-- | std/http/file_server_test.ts | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/std/http/file_server_test.ts b/std/http/file_server_test.ts index d8df631b8..3368b2e15 100644 --- a/std/http/file_server_test.ts +++ b/std/http/file_server_test.ts @@ -206,6 +206,21 @@ Deno.test("file_server running as library", async function (): Promise<void> { } }); +Deno.test("file_server should ignore query params", async () => { + await startFileServer(); + try { + const res = await fetch("http://localhost:4507/README.md?key=value"); + assertEquals(res.status, 200); + const downloadedFile = await res.text(); + const localFile = new TextDecoder().decode( + await Deno.readFile(join(moduleDir, "README.md")), + ); + assertEquals(downloadedFile, localFile); + } finally { + await killFileServer(); + } +}); + async function startTlsFileServer({ target = ".", port = 4577, |