Skip to content

Header Content-Length not being send #25349

@Shoghy

Description

@Shoghy

What version of Bun is running?

1.3.3+274e01c73

What platform is your computer?

Darwin 24.6.0 arm64 arm

What steps can reproduce the bug?

I am trying to call an endpoint that depends on the Content-Length header. It appears that bun don't automatically send this header, and even if I define it, it is not sent, making me unable to do a request to such endpoint. I am able to call the endpoint successfully in Node.

What is the expected behavior?

Automatically send the Content-Length header, or allowing the user to send any header with the fetch function.

What do you see instead?

An error response sent by the endpoint

Additional information

I was able to verify this using postman. When I disable the Content-Length header, the endpoint responded with the same error bun gets. The data sent is a string.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions