From b3e77a569012801806c21eba8dba03f4a4341e9d Mon Sep 17 00:00:00 2001 From: Vse Mozhet Byt Date: Wed, 28 Nov 2018 16:48:07 +0200 Subject: [PATCH] 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: https://github.com/nodejs/node/pull/24697 Reviewed-By: Gus Caplan Reviewed-By: Colin Ihrig Reviewed-By: Anto Aravinth Reviewed-By: Sam Roberts --- doc/api/http.md | 40 ++++++++++++++++++++-------------------- doc/api/https.md | 16 +++++++++------- 2 files changed, 29 insertions(+), 27 deletions(-) diff --git a/doc/api/http.md b/doc/api/http.md index 7288acce728dc6..f303fa00fd79de 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -937,6 +937,26 @@ added: v0.1.90 Stops the server from accepting new connections. See [`net.Server.close()`][]. +### server.headersTimeout + + +* {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. @@ -958,26 +978,6 @@ added: v0.7.0 Limits maximum incoming headers count. If set to 0, no limit will be applied. -### server.headersTimeout - - -* {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]) +- {number} **Default:** `40000` + +See [`http.Server#headersTimeout`][]. + ### server.listen() Starts the HTTPS server listening for encrypted connections. @@ -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])