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

doc: remove warning from response.writeHead #32700

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions doc/api/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -1713,12 +1713,9 @@ const server = http.createServer((req, res) => {
});
```

`Content-Length` is given in bytes not characters. The above example
works because the string `'hello world'` contains only single byte characters.
If the body contains higher coded characters then `Buffer.byteLength()`
should be used to determine the number of bytes in a given encoding.
And Node.js does not check whether `Content-Length` and the length of the body
which has been transmitted are equal or not.
`Content-Length` is given in bytes, not characters. Node.js does not check
whether `Content-Length` and the length of the body which has been transmitted
are equal or not.

Attempting to set a header field name or value that contains invalid characters
will result in a [`TypeError`][] being thrown.
Expand Down