fix readablestream bodies

This commit is contained in:
Toshit Chawda 2024-07-08 13:50:54 -07:00
parent 903d5a6720
commit eca9d42da6
No known key found for this signature in database
GPG key ID: 91480ED99E2B3D9D
5 changed files with 17 additions and 7 deletions

View file

@ -63,10 +63,20 @@ onmessage = async (msg) => {
return t1 - t0;
};
const readableStream = (buffer) => {
return new ReadableStream({
start(controller) {
controller.enqueue(buffer);
controller.close();
}
});
};
if (should_feature_test) {
let formdata = new FormData();
formdata.append("a", "b");
for (const url of [
["https://httpbin.org/post", { method: "POST", body: readableStream((new TextEncoder()).encode("abc")) }],
["https://httpbin.org/get", {}],
["https://httpbin.org/gzip", {}],
["https://httpbin.org/brotli", {}],