Skip to content

Commit 54cb3c5

Browse files
lpincaBenjamin Gruenbaum
authored and
Benjamin Gruenbaum
committed
doc: update description of 'clientError' event
Default behavior is to send a '400 Bad Request' response if the socket is writable. PR-URL: #18885 Refs: #15324 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent 0329643 commit 54cb3c5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

doc/api/http.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -784,10 +784,11 @@ changes:
784784

785785
If a client connection emits an `'error'` event, it will be forwarded here.
786786
Listener of this event is responsible for closing/destroying the underlying
787-
socket. For example, one may wish to more gracefully close the socket with an
788-
HTTP '400 Bad Request' response instead of abruptly severing the connection.
787+
socket. For example, one may wish to more gracefully close the socket with a
788+
custom HTTP response instead of abruptly severing the connection.
789789

790-
Default behavior is to destroy the socket immediately on malformed request.
790+
Default behavior is to close the socket with an HTTP '400 Bad Request' response
791+
if possible, otherwise the socket is immediately destroyed.
791792

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

0 commit comments

Comments
 (0)