nodejs/undici#1115
We have missed updating the docs.
This property is guaranteed to be an instance of the <net.Socket> class, a subclass of <stream.Duplex>, unless the user specified a socket type other than <net.Socket>.
Is no longer true. It will be null after detach and destroy.
|
ServerResponse.prototype.detachSocket = function detachSocket(socket) { |
|
assert(socket._httpMessage === this); |
|
socket.removeListener('close', onServerResponseClose); |
|
socket._httpMessage = null; |
|
this.socket = null; |
|
req.destroyed = true; |
|
if (req.res) { |
|
// Detach socket from IncomingMessage to avoid destroying the freed |
|
// socket in IncomingMessage.destroy(). |
|
req.res.socket = null; |
|
} |
|
if (isServerRequest(stream)) { |
|
stream.socket = null; |
|
stream.destroy(err); |
nodejs/undici#1115
We have missed updating the docs.
Is no longer true. It will be null after detach and destroy.
node/lib/_http_server.js
Lines 246 to 250 in 265a47d
node/lib/_http_client.js
Lines 661 to 666 in 265a47d
node/lib/internal/streams/destroy.js
Lines 339 to 341 in 265a47d