Skip to content
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

can't set statusText #13817

Open
lanezhao opened this issue Sep 9, 2024 · 4 comments
Open

can't set statusText #13817

lanezhao opened this issue Sep 9, 2024 · 4 comments
Labels
bug Something isn't working needs triage

Comments

@lanezhao
Copy link

lanezhao commented Sep 9, 2024

What version of Bun is running?

1.1.27+267afa293

What platform is your computer?

Darwin 23.6.0 arm64 arm

What steps can reproduce the bug?

Set statusText not working. It's a basically need when create http server. Please fix it.

const port = 4444;

bun.serve({
  port,
  fetch() {
    return new Response('', {
      statusText: 'customStatusText',
    });
  },
});

const host = `http://localhost:${port}`;

await fetch(`${host}`)
  .then((res) => {
    console.debug({ statusText: res.statusText });
  });

What is the expected behavior?

No response

What do you see instead?

No response

Additional information

No response

@lanezhao lanezhao added bug Something isn't working needs triage labels Sep 9, 2024
@lanezhao lanezhao changed the title can't set custom statusText can't set statusText Sep 9, 2024
@coratgerl
Copy link
Contributor

A PR is open to fix this

#10266

@lanezhao
Copy link
Author

lanezhao commented Sep 10, 2024

A PR is open to fix this

#10266

I know, but it seems to have lasted for a long time. It shouldn't be a complicated bug. I hope it can be fixed soon.

usually put the debug info in statusText of 400 error code. But now the problem forces me to add debug field in body to solve this problem. I don't think this is a perfect solution.

@lanezhao
Copy link
Author

Is there a plan or schedule to fix this? Or is it not being fixed in the near future? If possible, please provide some feedback on this issue.

@lanezhao
Copy link
Author

lanezhao commented Nov 5, 2024

Can same one 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 Please!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

2 participants