Coder Social home page Coder Social logo

req.socket might be null about finalhandler HOT 3 OPEN

pillarjs avatar pillarjs commented on May 13, 2024
req.socket might be null

from finalhandler.

Comments (3)

dougwilson avatar dougwilson commented on May 13, 2024

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.

from finalhandler.

dougwilson avatar dougwilson commented on May 13, 2024

Sorry for the delay on this. It seems very convoluted on when exactly Node.js will make req.socket null. 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 👍

from finalhandler.

blazzy avatar blazzy commented on May 13, 2024

@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.

from finalhandler.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.