You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for reporting, @Gerhut ! I do indeed see the Node.js docs have updated to note that req.socket is no longer guaranteed to be there, and that there is a code path within Node.js itself that now unsets it. I will get a patch out for this module to account for this new behavior.
Sorry for the delay on this. It seems very convoluted on when exactly Node.js will make req.socketnull. I see that there is a guard against that in req.destroy(), though not a lot of other methods on req. I believe we can just call req.destroy() anyway, just verifying that will behave as expected across the supported Node.js versions of this module before landing, as it would be the simplest solution 👍
@dougwilson Any luck with this? I'm running into an occasional error where req.socket is null and req.socket.destroy ends up blowing up.
Undici in particular is clearing out the socket when we stream a request through it and the connection is suddenly killed.
Just opened #57 with a fix for this. Planning on releasing it in the current major and then pulling it into express asap. Moving any discussion over there now.
Activity
dougwilson commentedon Jul 4, 2022
Thanks for reporting, @Gerhut ! I do indeed see the Node.js docs have updated to note that
req.socketis no longer guaranteed to be there, and that there is a code path within Node.js itself that now unsets it. I will get a patch out for this module to account for this new behavior.dougwilson commentedon Jul 13, 2022
Sorry for the delay on this. It seems very convoluted on when exactly Node.js will make
req.socketnull. I see that there is a guard against that inreq.destroy(), though not a lot of other methods onreq. I believe we can just callreq.destroy()anyway, just verifying that will behave as expected across the supported Node.js versions of this module before landing, as it would be the simplest solution 👍blazzy commentedon Jun 21, 2023
@dougwilson Any luck with this? I'm running into an occasional error where req.socket is null and req.socket.destroy ends up blowing up.
Undici in particular is clearing out the socket when we stream a request through it and the connection is suddenly killed.
wesleytodd commentedon Sep 1, 2024
Just opened #57 with a fix for this. Planning on releasing it in the current major and then pulling it into
expressasap. Moving any discussion over there now.