Reduce chances of write errors while the request is sent.
Refs: https://github.com/nodejs/node/pull/56756
PR-URL: https://github.com/nodejs/node/pull/56757
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Stefan Stojanovic <stefan.stojanovic@janeasystems.com>
By its own nature, the function returned by `common.mustSucceed()`
cannot be used as a listener for `'error'` events.
Write errors like `read ECONNRESET` or `write EPIPE`, should be ignored
because the socket might be closed by the other peer while the request
is sent.
Refs: 3caa2c1a00
PR-URL: https://github.com/nodejs/node/pull/56756
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Let’s not have bad examples in our test suite and instead use the
proper way of converting stream data to UTF-8
(i.e. `stream.setEncoding('utf8')`) in all places.
PR-URL: https://github.com/nodejs/node/pull/43731
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>