mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2025-05-10 09:43:51 +00:00
Fix #685
This commit is contained in:
parent
143b2dd15a
commit
09fdf4eacd
@ -4881,7 +4881,10 @@ inline bool ClientImpl::write_request(Stream &strm, const Request &req,
|
|||||||
auto length = std::to_string(req.content_length);
|
auto length = std::to_string(req.content_length);
|
||||||
headers.emplace("Content-Length", length);
|
headers.emplace("Content-Length", length);
|
||||||
} else {
|
} else {
|
||||||
headers.emplace("Content-Length", "0");
|
if (req.method == "POST" || req.method == "PUT" ||
|
||||||
|
req.method == "PATCH") {
|
||||||
|
headers.emplace("Content-Length", "0");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!req.has_header("Content-Type")) {
|
if (!req.has_header("Content-Type")) {
|
||||||
@ -5844,7 +5847,7 @@ inline void SSLClient::set_ca_cert_path(const char *ca_cert_file_path,
|
|||||||
|
|
||||||
inline void SSLClient::set_ca_cert_store(X509_STORE *ca_cert_store) {
|
inline void SSLClient::set_ca_cert_store(X509_STORE *ca_cert_store) {
|
||||||
if (ca_cert_store) {
|
if (ca_cert_store) {
|
||||||
if(ctx_) {
|
if (ctx_) {
|
||||||
if (SSL_CTX_get_cert_store(ctx_) != ca_cert_store) {
|
if (SSL_CTX_get_cert_store(ctx_) != ca_cert_store) {
|
||||||
// Free memory allocated for old cert and use new store `ca_cert_store`
|
// Free memory allocated for old cert and use new store `ca_cert_store`
|
||||||
SSL_CTX_set_cert_store(ctx_, ca_cert_store);
|
SSL_CTX_set_cert_store(ctx_, ca_cert_store);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user