mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-15 23:55:03 +03:00
Merge pull request #3365 from JakubOnderka/disable-expect
Disable Expect when sending audit logs to remote HTTP server
This commit is contained in:
commit
990d99b1fb
@ -110,15 +110,18 @@ bool HttpsClient::download(const std::string &uri) {
|
|||||||
curl_easy_setopt(curl, CURLOPT_WRITEDATA, this);
|
curl_easy_setopt(curl, CURLOPT_WRITEDATA, this);
|
||||||
|
|
||||||
curl_easy_setopt(curl, CURLOPT_USERAGENT, "ModSecurity3");
|
curl_easy_setopt(curl, CURLOPT_USERAGENT, "ModSecurity3");
|
||||||
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers_chunk);
|
|
||||||
|
|
||||||
/* We want Curl to return error in case there is an HTTP error code */
|
/* We want Curl to return error in case there is an HTTP error code */
|
||||||
curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1);
|
curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1);
|
||||||
|
|
||||||
if (m_requestBody.empty() == false) {
|
if (m_requestBody.empty() == false) {
|
||||||
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, m_requestBody.c_str());
|
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, m_requestBody.c_str());
|
||||||
|
headers_chunk = curl_slist_append(headers_chunk, "Expect:"); // Disable Expect: 100-continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* set HTTP headers for request */
|
||||||
|
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers_chunk);
|
||||||
|
|
||||||
res = curl_easy_perform(curl);
|
res = curl_easy_perform(curl);
|
||||||
|
|
||||||
curl_slist_free_all(headers_chunk);
|
curl_slist_free_all(headers_chunk);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user