1
0
mirror of synced 2025-12-01 23:17:49 +03:00
Enhance request handling: add support for requests without Content-Length or Transfer-Encoding headers
This commit is contained in:
yhirose
2025-11-25 20:30:43 -05:00
parent 9e7861b0b4
commit 337fbb0793
2 changed files with 78 additions and 4 deletions

View File

@@ -7932,7 +7932,11 @@ inline bool Server::read_content_core(
size_t /*len*/) { return receiver(buf, n); };
}
if (req.method == "DELETE" && !req.has_header("Content-Length")) {
// RFC 7230 Section 3.3.3: If this is a request message and none of the above
// are true (no Transfer-Encoding and no Content-Length), then the message
// body length is zero (no message body is present).
if (!req.has_header("Content-Length") &&
!detail::is_chunked_transfer_encoding(req.headers)) {
return true;
}