diff options
-rw-r--r-- | js/fetch.ts | 5 | ||||
-rw-r--r-- | js/fetch_test.ts | 3 |
2 files changed, 5 insertions, 3 deletions
diff --git a/js/fetch.ts b/js/fetch.ts index a28a81535..7cbaf7f10 100644 --- a/js/fetch.ts +++ b/js/fetch.ts @@ -403,6 +403,11 @@ export async function fetch( url = input.url; method = input.method; headers = input.headers; + + //@ts-ignore + if (input._bodySource) { + body = new DataView(await input.arrayBuffer()); + } } // Send Fetch message diff --git a/js/fetch_test.ts b/js/fetch_test.ts index 5bec33d41..b93f7845a 100644 --- a/js/fetch_test.ts +++ b/js/fetch_test.ts @@ -99,7 +99,6 @@ testPerm({ net: true }, async function fetchInitStringBody(): Promise<void> { assert(response.headers.get("content-type").startsWith("text/plain")); }); -/* TODO(ry) Re-enable this test. testPerm({ net: true }, async function fetchRequestInitStringBody(): Promise< void > { @@ -111,9 +110,7 @@ testPerm({ net: true }, async function fetchRequestInitStringBody(): Promise< const response = await fetch(req); const text = await response.text(); assertEquals(text, data); - assert(response.headers.get("content-type").startsWith("text/plain")); }); -*/ testPerm({ net: true }, async function fetchInitTypedArrayBody(): Promise< void |