Skip to content

Commit 3df64af

Browse files
authored
Update HTTPMessage.cpp - Zero Content-Length is acceptable
1 parent 48430dd commit 3df64af

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/HTTPMessage.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,10 @@ bool HTTPMessage::parseBody() {
204204
parseErrorStr = std::format("Content-Length ({}) is greater than remaining bytes ({})", hlenstr, bytesRemaining());
205205
return false;
206206
} else if (contentLen == 0) {
207-
parseErrorStr = "Content-Length is zero";
208-
return false;
207+
// Nothing to read, which is fine
208+
return true;
209209
} else {
210-
// Otherwise, we ca probably trust Content-Length is valid and read the specificed number of bytes
210+
// Otherwise, we can probably trust Content-Length is valid and read the specificed number of bytes
211211
dataLen = contentLen;
212212
}
213213

0 commit comments

Comments
 (0)