mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2025-05-10 09:43:51 +00:00
Fix #609
This commit is contained in:
parent
c8adac30f4
commit
951e46929e
@ -3189,8 +3189,7 @@ get_range_offset_and_length(const Request &req, const Response &res,
|
|||||||
|
|
||||||
inline bool expect_content(const Request &req) {
|
inline bool expect_content(const Request &req) {
|
||||||
if (req.method == "POST" || req.method == "PUT" || req.method == "PATCH" ||
|
if (req.method == "POST" || req.method == "PUT" || req.method == "PATCH" ||
|
||||||
req.method == "PRI" ||
|
req.method == "PRI" || req.method == "DELETE") {
|
||||||
(req.method == "DELETE" && req.has_header("Content-Length"))) {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// TODO: check if Content-Length is set
|
// TODO: check if Content-Length is set
|
||||||
@ -4153,6 +4152,10 @@ inline bool Server::read_content_core(Stream &strm, Request &req, Response &res,
|
|||||||
out = receiver;
|
out = receiver;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (req.method == "DELETE" && !req.has_header("Content-Length")) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (!detail::read_content(strm, req, payload_max_length_, res.status, nullptr,
|
if (!detail::read_content(strm, req, payload_max_length_, res.status, nullptr,
|
||||||
out, true)) {
|
out, true)) {
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user