Description
Is your feature request related to a problem? Please describe.
Some express middleware check if httpRequest
has/had body. e.g body-parser.
And it depends on content-length
header.
Although a http request with body in http/1 must contain content-length header, http2 request with body can have no content-length
header.
We can use http2ServerRequest.stream.readable
only before readable stream ended to check if request might have body frame. I'm not sure how to check it after readable stream ended with current http2 compatibility APIs.
Describe the solution you'd like
I'd like to add new API to check if request had body, or readable stream had been read data after readable stream ended.
Describe alternatives you've considered
I notice that http2ServerRequest.stream._readableState.sync
can be used. However we should not use _readableState
.