Skip to content

Commit cd1e61c

Browse files
committed
doc: http.Server clientError default behavior slightly changed
Explain that in the case of a HPE_HEADER_OVERFLOW error Node.js will return a 431 Request Header Fields Too Large. PR-URL: #25605
1 parent 50b7711 commit cd1e61c

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

doc/api/http.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -829,6 +829,10 @@ changes:
829829
description: The `rawPacket` is the current buffer that just parsed. Adding
830830
this buffer to the error object of `'clientError'` event is to
831831
make it possible that developers can log the broken packet.
832+
- version: REPLACEME
833+
pr-url: https://github.com/nodejs/node/pull/25605
834+
description: The default behavior will return a 431 Request Header
835+
Fields Too Large if a HPE_HEADER_OVERFLOW error occurs.
832836
-->
833837

834838
* `exception` {Error}
@@ -839,8 +843,10 @@ Listener of this event is responsible for closing/destroying the underlying
839843
socket. For example, one may wish to more gracefully close the socket with a
840844
custom HTTP response instead of abruptly severing the connection.
841845

842-
Default behavior is to close the socket with an HTTP '400 Bad Request' response
843-
if possible, otherwise the socket is immediately destroyed.
846+
Default behavior is to try close the socket with a HTTP '400 Bad Request',
847+
or a HTTP '431 Request Header Fields Too Large' in the case of a
848+
[`HPE_HEADER_OVERFLOW`][] error. If the socket is not writable it is
849+
immediately destroyed.
844850

845851
`socket` is the [`net.Socket`][] object that the error originated from.
846852

@@ -2171,3 +2177,4 @@ not abort the request or do anything besides add a `'timeout'` event.
21712177
[`url.parse()`]: url.html#url_url_parse_urlstring_parsequerystring_slashesdenotehost
21722178
[Readable Stream]: stream.html#stream_class_stream_readable
21732179
[Stream]: stream.html#stream_stream
2180+
[`HPE_HEADER_OVERFLOW`]: errors.html#errors_hpe_header_overflow

0 commit comments

Comments
 (0)