Skip to content

Commit

Permalink
doc: http.Server clientError default behavior slightly changed
Browse files Browse the repository at this point in the history
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
  • Loading branch information
albertstill committed Feb 1, 2019
1 parent 50b7711 commit cd1e61c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions doc/api/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -829,6 +829,10 @@ changes:
description: The `rawPacket` is the current buffer that just parsed. Adding
this buffer to the error object of `'clientError'` event is to
make it possible that developers can log the broken packet.
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/25605
description: The default behavior will return a 431 Request Header
Fields Too Large if a HPE_HEADER_OVERFLOW error occurs.
-->

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

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

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

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

0 comments on commit cd1e61c

Please sign in to comment.