-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
fix(HTTP Server): can't set custom statusText #10266
base: main
Are you sure you want to change the base?
Conversation
@Jarred-Sumner This issue is problematic for my use case, can you review this one if you have the time ? 🙏 Thanks for all the work done ! |
I have the same issue. Please please fix it. It's a basically need to be when create http server. @Jarred-Sumner const port = 4444;
bun.serve({
port,
fetch() {
return new Response('', {
statusText: 'customStatusText',
});
},
});
const host = `http://localhost:${port}`;
await fetch(`${host}`)
.then((res) => {
console.debug({ res, statusText: res.statusText });
}); |
@Jarred-Sumner I think this code change has not been merged correctly. Problems have persisted in the last few versions. I need to use "custom statusText" in bun.js, for my open source framework. Please fix it. |
Can sameone respond? This is a major issue when creating web servers with Bun.js. I think it's not so difficult to fix. @Jarred-Sumner @dylan-conway @coratgerl Please!!! |
What does this PR do?
On node we can change the statusText in the Response. On Bun,
Bun.serve
andcreateServer
from node:http only returns the default statusText define here https://github.com/oven-sh/bun/blob/main/src/bun.js/api/server.zig#L1039.So actually the two following code doesn't change the statusText
How did you verify your code works?
I wrote automated tests