Set content-length for empty POST/PUT
fix(fetch): set content-length for empty POST/PUT (#12703)
Set content-length for empty POST/PUT0de6d1-fix-set-content-length-for-empty-post-putfixset content length empty post put
Committed by lucacasonato
commit message
fix(fetch): set content-length for empty POST/PUT (#12703)
This commit changes `fetch` to set `content-length: 0` on POST and PUT
requests with no body.Editor assessment
Set content-length for empty POST/PUT states the protocol correction precisely, and the body specifies the mechanism: fetch now sends content-length: 0 on bodyless POST and PUT requests. That one line turns the subject into a complete behavioral description, which is exactly what a protocol fix needs. The fetch scope and fix type are accurate, hygiene is clean, and no footer is required. A publishable example. The exact header value in the body removes any ambiguity about the protocol correction, which is what a reader wants.