From 02bc58d83253fd3be61787bb28b6b02e3aa71092 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Fri, 10 Apr 2020 09:51:17 -0400 Subject: BREAKING: Make fetch API more web compatible (#4687) - Removes the __fetch namespace from `deno types` - Response.redirect should be a static. - Response.body should not be AsyncIterable. - Disables the deno_proxy benchmark - Makes std/examples/curl.ts buffer the body before printing to stdout --- std/http/file_server_test.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'std/http/file_server_test.ts') diff --git a/std/http/file_server_test.ts b/std/http/file_server_test.ts index 404d133ae..dc14d2c57 100644 --- a/std/http/file_server_test.ts +++ b/std/http/file_server_test.ts @@ -79,7 +79,7 @@ test(async function serveFallback(): Promise { assert(res.headers.has("access-control-allow-origin")); assert(res.headers.has("access-control-allow-headers")); assertEquals(res.status, 404); - res.body.close(); + const _ = await res.text(); } finally { killFileServer(); } @@ -92,12 +92,12 @@ test(async function serveWithUnorthodoxFilename(): Promise { assert(res.headers.has("access-control-allow-origin")); assert(res.headers.has("access-control-allow-headers")); assertEquals(res.status, 200); - res.body.close(); + let _ = await res.text(); 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); - res.body.close(); + _ = await res.text(); } finally { killFileServer(); } @@ -118,7 +118,7 @@ test(async function servePermissionDenied(): Promise { try { const res = await fetch("http://localhost:4500/"); - res.body.close(); + const _ = await res.text(); assertStrContains( (await errReader.readLine()) as string, "run again with the --allow-read flag" -- cgit v1.2.3