Open DanielHerchenbach opened 1 year ago
Hello @DanielHerchenbach ,
You are correct. It's a known issue.
Also, it's planned for the next release.
Just for the reference:
I noticed this bug is still open. The workaround posted on stack exchange wasn't clear on what condition it would leave the body uncleared. Does a "persisted connection" mean any endpoint called prior to the errored endpoint would need to drain the body? or just the same endpoint with POST/PUT/DELETE that needs to drain the body? Do I need to drain the body on GET? If my service has 20+ endpoints, do I need to drain the body for all of them?
Also, just found out the suggested workaround on stack exchange doesn't work if there's no payload.
[oatpp::web::protocol::http::incoming::SimpleBodyDecoder::decode()]: Error. Invalid Request.
I don't know if client would provide request body or not.
Hello, let's say reading the body of a request is omitted because the endpoint definition contains something like:
if (acceptFileTransfer) { request->transferBodyToStream(&fileOutputStream); } else { // body not read! }
Maybe I am missing something but I guess in theelse
branch, the stream position is not moved to the end of the body. This is a problem for the next request on the same connection (if any) because its headers are then parsed starting from the previous body section.