Skip to content

Commit 38cf3cf

Browse files
lpincaaddaleax
authored andcommitted
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 e447580 commit 38cf3cf

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

doc/api/http.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -748,10 +748,11 @@ changes:
748748

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

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

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

0 commit comments

Comments
 (0)