Skip to content

Commit

Permalink
doc: fix nits in http(s) server.headersTimeout
Browse files Browse the repository at this point in the history
* Fix sort orders of sections and bottom references.
* Fix links.
* Unify spelling.
* Add missing YAML block.

PR-URL: #24697
Reviewed-By: Gus Caplan <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Anto Aravinth <[email protected]>
Reviewed-By: Sam Roberts <[email protected]>
  • Loading branch information
vsemozhetbyt authored and targos committed Nov 29, 2018
1 parent 992a904 commit b3e77a5
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 27 deletions.
40 changes: 20 additions & 20 deletions doc/api/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -937,6 +937,26 @@ added: v0.1.90

Stops the server from accepting new connections. See [`net.Server.close()`][].

### server.headersTimeout
<!-- YAML
added: v11.3.0
-->

* {number} **Default:** `40000`

Limit the amount of time the parser will wait to receive the complete HTTP
headers.

In case of inactivity, the rules defined in [`server.timeout`][] apply. However,
that inactivity based timeout would still allow the connection to be kept open
if the headers are being sent very slowly (by default, up to a byte per 2
minutes). In order to prevent this, whenever header data arrives an additional
check is made that more than `server.headersTimeout` milliseconds has not
passed since the connection was established. If the check fails, a `'timeout'`
event is emitted on the server object, and (by default) the socket is destroyed.
See [`server.timeout`][] for more information on how timeout behavior can be
customized.

### server.listen()

Starts the HTTP server listening for connections.
Expand All @@ -958,26 +978,6 @@ added: v0.7.0

Limits maximum incoming headers count. If set to 0, no limit will be applied.

### server.headersTimeout
<!-- YAML
added: v11.3.0
-->

* {number} **Default:** `40000`

Limit the amount of time the parser will wait to receive the complete HTTP
headers.

In case of inactivity, the rules defined in [server.timeout][] apply. However,
that inactivity based timeout would still allow the connection to be kept open
if the headers are being sent very slowly (by default, up to a byte per 2
minutes). In order to prevent this, whenever header data arrives an additional
check is made that more than `server.headersTimeout` milliseconds has not
passed since the connection was established. If the check fails, a `'timeout'`
event is emitted on the server object, and (by default) the socket is destroyed.
See [server.timeout][] for more information on how timeout behaviour can be
customised.

### server.setTimeout([msecs][, callback])
<!-- YAML
added: v0.9.12
Expand Down
16 changes: 9 additions & 7 deletions doc/api/https.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ added: v0.1.90

See [`server.close()`][`http.close()`] from the HTTP module for details.

### server.headersTimeout
<!-- YAML
added: v11.3.0
-->
- {number} **Default:** `40000`

See [`http.Server#headersTimeout`][].

### server.listen()

Starts the HTTPS server listening for encrypted connections.
Expand All @@ -44,12 +52,6 @@ This method is identical to [`server.listen()`][] from [`net.Server`][].

See [`http.Server#maxHeadersCount`][].

### server.headersTimeout

- {number} **Default:** `40000`

See [`http.Server#headersTimeout`][].

### server.setTimeout([msecs][, callback])
<!-- YAML
added: v0.11.2
Expand Down Expand Up @@ -367,9 +369,9 @@ headers: max-age=0; pin-sha256="WoiWRyIOVNa9ihaBciRSC7XHjliYS9VwUGOIud4PB18="; p
[`Agent`]: #https_class_https_agent
[`URL`]: url.html#url_the_whatwg_url_api
[`http.Agent`]: http.html#http_class_http_agent
[`http.Server#headersTimeout`]: http.html#http_server_headerstimeout
[`http.Server#keepAliveTimeout`]: http.html#http_server_keepalivetimeout
[`http.Server#maxHeadersCount`]: http.html#http_server_maxheaderscount
[`http.Server#headersTimeout`]: http.html#http_server_headerstimeout
[`http.Server#setTimeout()`]: http.html#http_server_settimeout_msecs_callback
[`http.Server#timeout`]: http.html#http_server_timeout
[`http.Server`]: http.html#http_class_http_server
Expand Down

0 comments on commit b3e77a5

Please sign in to comment.