Skip to content

Commit

Permalink
doc: update content-length reference
Browse files Browse the repository at this point in the history
  • Loading branch information
sidwebworks committed Aug 26, 2022
1 parent 600523b commit b4ea117
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion doc/api/errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -1327,7 +1327,7 @@ When using [`fs.cp()`][], `src` or `dest` pointed to an invalid path.

### `ERR_HTTP_CONTENT_LENGTH_MISMATCH`

The response body size did not match with the specified content-length set in header.
Response body size doesn't match with the specified content-length header value.

<a id="ERR_HTTP_CONTENT_LENGTH_MISMATCH"></a>

Expand Down
10 changes: 5 additions & 5 deletions doc/api/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ For backward compatibility, `res` will only emit `'error'` if there is an
`'error'` listener registered.

Set `Content-Length` header to limit the response body size. Mismatching the
`Content-Length` header value will result in an [`Error`][] being thrown,
`Content-Length` header value will result in an \[`Error`]\[] being thrown,
identified by `code:` [`'ERR_HTTP_CONTENT_LENGTH_MISMATCH'`][].

`Content-Length` value should be in bytes, not characters. Use
Expand Down Expand Up @@ -2244,13 +2244,13 @@ const server = http.createServer((req, res) => {
});
```

`Content-Length` is given in bytes, not characters. Use
`Content-Length` is read in bytes, not characters. Use
[`Buffer.byteLength()`][] to determine the length of the body in bytes. Node.js
does not check whether `Content-Length` and the length of the body which has
will 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.
will result in a \[`Error`]\[] being thrown.

### `response.writeProcessing()`

Expand Down Expand Up @@ -3687,6 +3687,7 @@ added: REPLACEME
Set the maximum number of idle HTTP parsers. **Default:** `1000`.

[RFC 8187]: https://www.rfc-editor.org/rfc/rfc8187.txt
[`'ERR_HTTP_CONTENT_LENGTH_MISMATCH'`]: errors.md#err_http_content_length_mismatch
[`'checkContinue'`]: #event-checkcontinue
[`'finish'`]: #event-finish
[`'request'`]: #event-request
Expand All @@ -3698,7 +3699,6 @@ Set the maximum number of idle HTTP parsers. **Default:** `1000`.
[`Buffer.byteLength()`]: buffer.md#static-method-bufferbytelengthstring-encoding
[`Duplex`]: stream.md#class-streamduplex
[`HPE_HEADER_OVERFLOW`]: errors.md#hpe_header_overflow
[`'ERR_HTTP_CONTENT_LENGTH_MISMATCH'`]: errors.md#err_http_content_length_mismatch
[`TypeError`]: errors.md#class-typeerror
[`URL`]: url.md#the-whatwg-url-api
[`agent.createConnection()`]: #agentcreateconnectionoptions-callback
Expand Down

0 comments on commit b4ea117

Please sign in to comment.