Skip to content

Commit b3e77a5

Browse files
vsemozhetbyttargos
authored andcommitted
doc: fix nits in http(s) server.headersTimeout
* Fix sort orders of sections and bottom references. * Fix links. * Unify spelling. * Add missing YAML block. PR-URL: #24697 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
1 parent 992a904 commit b3e77a5

File tree

2 files changed

+29
-27
lines changed

2 files changed

+29
-27
lines changed

doc/api/http.md

+20-20
Original file line numberDiff line numberDiff line change
@@ -937,6 +937,26 @@ added: v0.1.90
937937

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

940+
### server.headersTimeout
941+
<!-- YAML
942+
added: v11.3.0
943+
-->
944+
945+
* {number} **Default:** `40000`
946+
947+
Limit the amount of time the parser will wait to receive the complete HTTP
948+
headers.
949+
950+
In case of inactivity, the rules defined in [`server.timeout`][] apply. However,
951+
that inactivity based timeout would still allow the connection to be kept open
952+
if the headers are being sent very slowly (by default, up to a byte per 2
953+
minutes). In order to prevent this, whenever header data arrives an additional
954+
check is made that more than `server.headersTimeout` milliseconds has not
955+
passed since the connection was established. If the check fails, a `'timeout'`
956+
event is emitted on the server object, and (by default) the socket is destroyed.
957+
See [`server.timeout`][] for more information on how timeout behavior can be
958+
customized.
959+
940960
### server.listen()
941961

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

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

961-
### server.headersTimeout
962-
<!-- YAML
963-
added: v11.3.0
964-
-->
965-
966-
* {number} **Default:** `40000`
967-
968-
Limit the amount of time the parser will wait to receive the complete HTTP
969-
headers.
970-
971-
In case of inactivity, the rules defined in [server.timeout][] apply. However,
972-
that inactivity based timeout would still allow the connection to be kept open
973-
if the headers are being sent very slowly (by default, up to a byte per 2
974-
minutes). In order to prevent this, whenever header data arrives an additional
975-
check is made that more than `server.headersTimeout` milliseconds has not
976-
passed since the connection was established. If the check fails, a `'timeout'`
977-
event is emitted on the server object, and (by default) the socket is destroyed.
978-
See [server.timeout][] for more information on how timeout behaviour can be
979-
customised.
980-
981981
### server.setTimeout([msecs][, callback])
982982
<!-- YAML
983983
added: v0.9.12

doc/api/https.md

+9-7
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ added: v0.1.90
3232

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

35+
### server.headersTimeout
36+
<!-- YAML
37+
added: v11.3.0
38+
-->
39+
- {number} **Default:** `40000`
40+
41+
See [`http.Server#headersTimeout`][].
42+
3543
### server.listen()
3644

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

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

47-
### server.headersTimeout
48-
49-
- {number} **Default:** `40000`
50-
51-
See [`http.Server#headersTimeout`][].
52-
5355
### server.setTimeout([msecs][, callback])
5456
<!-- YAML
5557
added: v0.11.2
@@ -367,9 +369,9 @@ headers: max-age=0; pin-sha256="WoiWRyIOVNa9ihaBciRSC7XHjliYS9VwUGOIud4PB18="; p
367369
[`Agent`]: #https_class_https_agent
368370
[`URL`]: url.html#url_the_whatwg_url_api
369371
[`http.Agent`]: http.html#http_class_http_agent
372+
[`http.Server#headersTimeout`]: http.html#http_server_headerstimeout
370373
[`http.Server#keepAliveTimeout`]: http.html#http_server_keepalivetimeout
371374
[`http.Server#maxHeadersCount`]: http.html#http_server_maxheaderscount
372-
[`http.Server#headersTimeout`]: http.html#http_server_headerstimeout
373375
[`http.Server#setTimeout()`]: http.html#http_server_settimeout_msecs_callback
374376
[`http.Server#timeout`]: http.html#http_server_timeout
375377
[`http.Server`]: http.html#http_class_http_server

0 commit comments

Comments
 (0)