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

Bun fails with Malformed_HTTP_Response when header name contains question mark #15938

Open
hrgdavor opened this issue Dec 22, 2024 · 1 comment
Labels
bug Something isn't working needs triage

Comments

@hrgdavor
Copy link

What version of Bun is running?

1.1.42+50eec0025

What platform is your computer?

Linux 4.18.0-372.32.1.el8_6.x86_64 x86_64 x86_64

What steps can reproduce the bug?

use netcat to fake a web server and return following

HTTP/1.1 200 OK
Access-Control-Allow-Method?: *
Content-Type: text/plain
Content-Length: 1

A

This silly bug was caused by wrong header name in code using jettty (':' was converted to '?')

resp.setHeader("Access-Control-Allow-Method:", "*");

Problem 1 is that source setting header on java side and output were different
problem 2 is that bun did not report detail of which header is invalid, just a generic error

What is the expected behavior?

  • a) ignore the header (print warning in verbose)
  • b) throw error saying which header name is wrong

What do you see instead?

generic error Malformed_HTTP_Response

Additional information

No response

@hrgdavor hrgdavor added bug Something isn't working needs triage labels Dec 22, 2024
@hrgdavor
Copy link
Author

Also, tested with node 23. it simply ignores invalid headers. So this would be preferred solution.

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

1 participant