-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
What version of Bun is running?
1.1.38+bf2f153f5
What platform is your computer?
Microsoft Windows NT 10.0.19045.0 x64
What steps can reproduce the bug?
For the following code
import { createServer } from 'http';
const server = createServer();
server.on('request', (req, res) => {
res.writeHead(200, {
'Content-Type': 'text/event-stream',
'Cache-Control': 'no-cache',
'Connection': 'keep-alive',
});
res.write(`id: ${Date.now()}\ndata: Message 1\n\n`);
// Bun does not write the first message until the second message is sent.
// setTimeout(() => {
// res.write(`id: ${Date.now()}\ndata: Message 2\n\n`);
// }, 1000);
});
server.listen(8000);
After sending a request (Via curl localhost:8000, for example)
- Bun never responds to the request, not sending data nor headers
- Node correctly sends the response
- If the settimeout block is uncommented, bun sends a response after one second, including both the first and second message
What is the expected behavior?
Bun's behaviour should match node's
What do you see instead?
Bun's behaviour does not match node's
Additional information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working