mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2025-05-15 09:18:27 +00:00
Fix #136
This commit is contained in:
parent
acc5e5a450
commit
8483e5931f
2 changed files with 17 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue