fix: Allow ArrayBuffer as Fetch request body (#5831)

This commit is contained in:
Marcos Casagrande 2020-05-25 15:26:36 +02:00 committed by GitHub
parent c9f0e34e29
commit 1c4a9665e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 0 deletions

View file

@ -258,6 +258,19 @@ unitTest(
}
);
unitTest(
{ perms: { net: true } },
async function fetchInitArrayBufferBody(): Promise<void> {
const data = "Hello World";
const response = await fetch("http://localhost:4545/echo_server", {
method: "POST",
body: new TextEncoder().encode(data).buffer,
});
const text = await response.text();
assertEquals(text, data);
}
);
unitTest(
{ perms: { net: true } },
async function fetchInitURLSearchParamsBody(): Promise<void> {