]>
git.kaiwu.me - njs.git/commit
Fetch: fixed handling of Content-Length header when body is provided.
body value length takes precedence over Content-Length from header list.
https://fetch.spec.whatwg.org/#http-network-or-cache-fetch
Let contentLength be httpRequest’s body’s length, if httpRequest’s body
is non-null; otherwise null.
Let contentLengthHeaderValue be null.
If httpRequest’s body is null and httpRequest’s method is `POST` or
`PUT`, then set contentLengthHeaderValue to `0`.
If contentLength is non-null, then set contentLengthHeaderValue to
contentLength, serialized and isomorphic encoded.
If contentLengthHeaderValue is non-null, then append (`Content-Length`,
contentLengthHeaderValue) to httpRequest’s header list.
This fixes #930 issue in Github.