expressjs / expressjs/body-parser
Exclude specific route from body-parsersing
Open
question
- Dominant language
- JavaScript
- Stars
- 5.5k
- Forks
- 767
- Avg merge
- 13h 53m
- Merged PRs (30d)
- 10
Description
Hi, in the 1.X versione there is https://github.com/expressjs/body-parser/blob/1.x/lib/read.js#L45-L46
```js
// flag as parsed
req._body = true
```
I have used this flag for exclude a specific route from body parsersing, eg.:
```js
app.use((req, res, next) => {
if ( /^\/api\/wopi\/files\/([a-zA-Z0-9]+)\/contents$/.test(req.path.toLowerCase()) ) {
req['_body'] = true;
}
next();
});
```
In the 2.X version this flag disappear... How can I exclude a specific route from body parser?
Contributor guide
Assessment
This issue has not been assessed yet.