Open 9OP opened 1 year ago
I will try to replicate with Hono, it might be a Koa issue.
same issue, with nodejs directly:
const http = require('http');
const port = process.env.PORT || 9091
const server = http.createServer({
insecureHTTPParser: true
}, (req, res) => {
// Handle requests here
console.log("req received", req.url);
req.on("data", (chunk) => {
console.log('chunk received', chunk);
});
req.on("end", (chunk) => {
console.log('END chunk received', chunk);
});
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello, HTTP!');
});
server.listen(port, process.env.HOST_IP, () => {
console.log(`host started on port ${port}`)
});
Curl:
curl -X POST -H "Content-Type: application/json" -d '{"key1": "value1", "key2": "value2"}' https://your-url
What version of Bun is running?
1.0.2+37edd5a6e389265738e89265bcbdf2999cb81a49
What platform is your computer?
Darwin 22.4.0 x86_64 i386
What steps can reproduce the bug?
Context: I was trying to get raw binary data from a client using fetch API. It seems to work in Node but not in Bun.
Server code:
client code:
Response in node:
Response in bun:
What is the expected behavior?
Get the same result as Node. Get the binary data from the request object.
What do you see instead?
Instead no data binary data is being received.
Additional information
No response