Skip to content

set req.length  #214

Open
Open
@dcolens

Description

@dcolens

it would be nice that body-parser sets the length of the body, my use case is I'd like to know the length of a JSON payload POSTED using chunked-encoding, so there is no content-length header and req.body is set to an Object thanks to body-parser.

Sounds like the only way to get the body size is to stringify req.body and get the length :/ or use raw-parser and JSON.parse.

Any chance we could set req.length or similar to the size of the raw body before parsing it ? (other suggestions are welcome)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions