Comments (14)
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.
v15.12.0 on darwin.
from raw-body.
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.
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.
I am taking a look to see what is happening. It may be just that the docs need to be changed.
from raw-body.
Ok, also same behaviour on linux with node v14.16.0.
from raw-body.
It looks like it changed with nodejs/node@3d480dc where it will never dump once it was started reading.
from raw-body.
req._consuming
is true inside my error handler.
from raw-body.
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.
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.
Can you clarify what the typo is and/or make a PR?
from raw-body.
I think "progamatic" should be something else. (Just to note as I suppose that docs will be updated anyway.)
from raw-body.
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.
Is needed any more info?
from raw-body.
Related Issues (20)
- When the request connection is closed prematurely, the module never yields HOT 13
- Need to add a timeout option HOT 5
- If the stream has already emitted its end event, raw-body never yeilds HOT 4
- Parse error HOT 3
- Content-Type: text/xml Can not parse HOT 1
- Promise implementation as a option HOT 1
- readStream method and the aborted stream event HOT 5
- x-www-form-urlencoded request resulting in Request Aborted HOT 4
- Incorrect default encoding
- check limit before decoding bytes HOT 1
- Should `request size did not match content length` be considered an error in API HOT 10
- raw-body will hang when the param is a parsed body HOT 3
- Release new version for Node v10 HOT 10
- Update dependencies HOT 4
- koa example in readme is outdated HOT 3
- 2.5.0 breaks koa bodyparser on startup HOT 7
- TypeError: stream.on is not a function HOT 2
- Can't resolve 'async_hooks' in 'raw-body' HOT 1
- AsyncResource never emits `destroy` hook HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from raw-body.