Skip to content

Commit

Permalink
Update HTTP1xCodec.cpp
Browse files Browse the repository at this point in the history
Added extra check for ignoreBody with ContentLength header.
  • Loading branch information
SteveSelva authored Nov 20, 2024
1 parent 8d8c061 commit ca49659
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion proxygen/lib/http/codec/HTTP1xCodec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1198,7 +1198,8 @@ int HTTP1xCodec::onHeadersComplete(size_t len) {
ignoreBody = false;
} else {
is1xxResponse_ = msg_->is1xxResponse();
if (connectRequest_ && (msg_->is4xxResponse() || msg_->is5xxResponse())) {
std::string contentLengthHeader = msg_->getHeaders().getSingleOrEmpty(HTTP_HEADER_CONTENT_LENGTH);
if (connectRequest_ && (msg_->is4xxResponse() || msg_->is5xxResponse()) && !contentLengthHeader.empty() && std::stol(contentLengthHeader) != 0) {
ignoreBody = false;
} else if (expectNoResponseBody_) {
ignoreBody = true;
Expand Down

0 comments on commit ca49659

Please sign in to comment.