summaryrefslogtreecommitdiff
path: root/std/http/file_server_test.ts
diff options
context:
space:
mode:
authorAleksandrukTad <t.aleksandruk@gmail.com>2019-12-10 12:11:55 +0000
committerRy Dahl <ry@tinyclouds.org>2019-12-10 20:11:55 +0800
commit31ddfd5a42d658b92e954e44d3326a8e37ac9198 (patch)
treefddcbb19c78790cbfced08c855e3aa697f31d129 /std/http/file_server_test.ts
parentec7f3ce1c27d7c2d231a75d6a4eea82867d7ad2b (diff)
fix: decoding uri in file_server (#3187)
Diffstat (limited to 'std/http/file_server_test.ts')
-rw-r--r--std/http/file_server_test.ts14
1 files changed, 14 insertions, 0 deletions
diff --git a/std/http/file_server_test.ts b/std/http/file_server_test.ts
index 7d7e024e7..f725b32a2 100644
--- a/std/http/file_server_test.ts
+++ b/std/http/file_server_test.ts
@@ -79,3 +79,17 @@ test(async function serveFallback(): Promise<void> {
killFileServer();
}
});
+
+test(async function serveFallback(): Promise<void> {
+ await startFileServer();
+ try {
+ const 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);
+ } finally {
+ killFileServer();
+ }
+});