GithubHelp home page GithubHelp logo

Comments (14)

dougwilson avatar dougwilson commented on June 4, 2024

Hi @misos1 I'm not sure where Node.js write this in their docs, but this is where the magic happens internally to read off the rest of the request stream: https://github.com/nodejs/node/blob/master/lib/_http_server.js#L807-L811 . What version of Node.js are you using? I wonder if there has been a change in behavior (on purpose or accidentally). As for Express, that supports all the way down to Ndoe.js 0.10, which doesn't have that behavior.

from raw-body.

misos1 avatar misos1 commented on June 4, 2024

v15.12.0 on darwin.

from raw-body.

misos1 avatar misos1 commented on June 4, 2024

I think this comment makes sense. "raw-body" probably already started reading so this does not apply.

// If the user never called req.read(), and didn't pipe() or
// .resume() or .on('data'), then we call req._dump() so that the
// bytes will be pulled off the wire.

from raw-body.

dougwilson avatar dougwilson commented on June 4, 2024

Well, their comment assumes that it didn't stop reading. If you look at the properties it checks, it is checking for active read, which was undone by this module.

from raw-body.

dougwilson avatar dougwilson commented on June 4, 2024

I am taking a look to see what is happening. It may be just that the docs need to be changed.

from raw-body.

misos1 avatar misos1 commented on June 4, 2024

Ok, also same behaviour on linux with node v14.16.0.

from raw-body.

dougwilson avatar dougwilson commented on June 4, 2024

It looks like it changed with nodejs/node@3d480dc where it will never dump once it was started reading.

from raw-body.

misos1 avatar misos1 commented on June 4, 2024

req._consuming is true inside my error handler.

from raw-body.

dougwilson avatar dougwilson commented on June 4, 2024

Right, because you can see in that Node.js commit, it will only ever set it to true on the first read. There is no logic to set it back to false like there is with the readablestate property it was using before that change.

from raw-body.

misos1 avatar misos1 commented on June 4, 2024

Also there is typo in this sentence "The errors from this module have a type property which allows for the progamatic determination of the type of error returned.".

from raw-body.

dougwilson avatar dougwilson commented on June 4, 2024

Can you clarify what the typo is and/or make a PR?

from raw-body.

misos1 avatar misos1 commented on June 4, 2024

I think "progamatic" should be something else. (Just to note as I suppose that docs will be updated anyway.)

from raw-body.

dougwilson avatar dougwilson commented on June 4, 2024

Ah, gotcha. What should it be instead? I can make the update if you don't want to, just need to know what you're looking to change.

from raw-body.

misos1 avatar misos1 commented on June 4, 2024

Is needed any more info?

from raw-body.

Related Issues (20)

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.