This commit is contained in:
yhirose 2019-03-28 19:55:43 -04:00
parent acc5e5a450
commit 8483e5931f
2 changed files with 17 additions and 2 deletions

View file

@ -2119,8 +2119,10 @@ inline void Client::write_request(Stream& strm, Request& req)
req.set_header("Content-Type", "text/plain");
}
auto length = std::to_string(req.body.size());
req.set_header("Content-Length", length.c_str());
if (!req.has_header("Content-Length")) {
auto length = std::to_string(req.body.size());
req.set_header("Content-Length", length.c_str());
}
}
detail::write_headers(bstrm, req);