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

fix(ext/fetch): ignore user content-length header #15555

Merged
merged 1 commit into from
Aug 23, 2022

Conversation

lucacasonato
Copy link
Member

@lucacasonato lucacasonato commented Aug 23, 2022

Previously if a user specified a content-length header for an POST
request without a body, the request would contain two content-length
headers. One added by us, and one added by the user.

This commit ignores all content-length headers coming from the user,
because we need to have the sole authority on the content-length because
we transmit the body.

Fixes #15545

Previously if a user specified a content-length header for an POST
request without a body, the request would contain two `content-length`
headers. One added by us, and one added by the user.

This commit ignores all content-length headers coming from the user,
because we need to have the sole authority on the content-length because
we transmit the body.
@kitsonk
Copy link
Contributor

kitsonk commented Aug 23, 2022

This isn't going to break things like this in oak: https://github.com/oakserver/oak/blob/main/send.ts#L143-L195, right?

@lucacasonato
Copy link
Member Author

This is for outbound requests, not the http server.

@lucacasonato lucacasonato merged commit 24f7f3f into main Aug 23, 2022
@lucacasonato lucacasonato deleted the fetch_content_length branch August 23, 2022 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deno adds extra Content-Length: 0 header to fetch requests even when provided.
3 participants