mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2026-11-27 20:58:28 +00:00
Fix #136
This commit is contained in:
1 parent
acc5e5a450
commit
8483e5931f
2 files changed
+17
-2
No files matched your search
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user