This commit is contained in:
yhirose 2020-10-08 21:37:42 -04:00
parent 143b2dd15a
commit 09fdf4eacd

View file

@ -4881,8 +4881,11 @@ inline bool ClientImpl::write_request(Stream &strm, const Request &req,
auto length = std::to_string(req.content_length);
headers.emplace("Content-Length", length);
} else {
if (req.method == "POST" || req.method == "PUT" ||
req.method == "PATCH") {
headers.emplace("Content-Length", "0");
}
}
} else {
if (!req.has_header("Content-Type")) {
headers.emplace("Content-Type", "text/plain");