diff --git a/doc/api/errors.md b/doc/api/errors.md index 68ac599e7737f3..7de3ee9da2e58f 100644 --- a/doc/api/errors.md +++ b/doc/api/errors.md @@ -940,6 +940,11 @@ allowed size for a `Buffer`. An invalid symlink type was passed to the [`fs.symlink()`][] or [`fs.symlinkSync()`][] methods. + +### `ERR_HTTP_REQUEST_TIMEOUT` + +The client has not sent the entire request within the allowed time. + ### `ERR_HTTP_HEADERS_SENT` diff --git a/doc/api/http.md b/doc/api/http.md index d118acdf3668b9..29fdae5a3a8fd2 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -1256,6 +1256,23 @@ added: v0.7.0 Limits maximum incoming headers count. If set to 0, no limit will be applied. +### `server.requestTimeout` + + +* {number} **Default:** `0` + +Sets the timeout value in milliseconds for receiving the entire request from +the client. + +If the timeout expires, the server responds with status 408 without +forwarding the request to the request listener and then closes the connection. + +It must be set to a non-zero value (e.g. 120 seconds) to proctect against +potential Denial-of-Service attacks in case the server is deployed without a +reverse proxy in front. + ### `server.setTimeout([msecs][, callback])` + +* {number} **Default:** `0` + +See [`http.Server#requestTimeout`][]. + ### `server.setTimeout([msecs][, callback])`