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(fetch): set content-length for empty POST/PUT #12703

Merged
merged 2 commits into from
Nov 9, 2021

Conversation

lucacasonato
Copy link
Member

@lucacasonato lucacasonato commented Nov 9, 2021

This commit changes fetch to set content-length: 0 on POST and PUT
requests with no body.

The relevant fetch spec text:
image

Fixes #12597
Fixes #11920

Copy link
Contributor

@AaronO AaronO left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@AaronO
Copy link
Contributor

AaronO commented Nov 9, 2021

Might be useful to link to the spec in the comment

This commit changes `fetch` to set `content-length: 0` on POST and PUT
requests with no body.
@andreubotella
Copy link
Contributor

Are there no WPT tests for this?

@lucacasonato
Copy link
Member Author

Are there no WPT tests for this?

Couldn't find any. We should add some, but I didn't have the nerve to do it right now, considering we are releasing today 😉

@DjDeveloperr
Copy link
Contributor

Also fixes #11920

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants