-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Requests with Transfer-Encoding: chunked seems to be broken in Bun but not in Node #11621
Comments
This comment was marked as off-topic.
This comment was marked as off-topic.
I am not sure what you would like me to test with However I tried async function streamToString(stream) {
const chunks = [];
for await (const chunk of stream) {
chunks.push(Buffer.from(chunk));
}
return Buffer.concat(chunks).toString("utf-8");
}
Bun.serve({
port: 8080,
async fetch(req) {
console.log("req:")
console.log(req);
const result = await streamToString(req.body)
console.log("body:")
console.log(result);
return new Response("Bun!");
},
}); I sent this request with curl: server logs:
|
What version of Bun is running?
1.1.12
What platform is your computer?
Darwin 23.5.0 arm64 arm
What steps can reproduce the bug?
index.js
run the server with
bun ./index.js
make the request with
Transfer-Encoding: chunked
like this:curl -XPOST http://localhost:8080/registrations -F product_id=1234foobar567 -H 'Transfer-Encoding: chunked'
The server spits the following error:
What is the expected behavior?
Run the same server with node instead of bun, no errors occur.
What do you see instead?
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: