Skip to content

Commit 951e469

Browse files
committed
1 parent c8adac3 commit 951e469

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

httplib.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3189,8 +3189,7 @@ get_range_offset_and_length(const Request &req, const Response &res,
31893189

31903190
inline bool expect_content(const Request &req) {
31913191
if (req.method == "POST" || req.method == "PUT" || req.method == "PATCH" ||
3192-
req.method == "PRI" ||
3193-
(req.method == "DELETE" && req.has_header("Content-Length"))) {
3192+
req.method == "PRI" || req.method == "DELETE") {
31943193
return true;
31953194
}
31963195
// TODO: check if Content-Length is set
@@ -4153,6 +4152,10 @@ inline bool Server::read_content_core(Stream &strm, Request &req, Response &res,
41534152
out = receiver;
41544153
}
41554154

4155+
if (req.method == "DELETE" && !req.has_header("Content-Length")) {
4156+
return true;
4157+
}
4158+
41564159
if (!detail::read_content(strm, req, payload_max_length_, res.status, nullptr,
41574160
out, true)) {
41584161
return false;

0 commit comments

Comments
 (0)