提交 652be190 编写于 作者: K Kurt Mackey 提交者: Ryan Dahl

use body when Request instance is passed to fetch (fixes #2433) (#2435)

上级 8fb44eba
......@@ -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
......
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册