Skip to content

Commit b82d600

Browse files
committed
Disable Expect when sending audit logs to remote HTTP server
This will speed-up sending logs to remote server
1 parent 01a0615 commit b82d600

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/utils/https_client.cc

+4-1
Original file line numberDiff line numberDiff line change
@@ -110,15 +110,18 @@ bool HttpsClient::download(const std::string &uri) {
110110
curl_easy_setopt(curl, CURLOPT_WRITEDATA, this);
111111

112112
curl_easy_setopt(curl, CURLOPT_USERAGENT, "ModSecurity3");
113-
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers_chunk);
114113

115114
/* We want Curl to return error in case there is an HTTP error code */
116115
curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1);
117116

118117
if (m_requestBody.empty() == false) {
119118
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, m_requestBody.c_str());
119+
headers_chunk = curl_slist_append(headers_chunk, "Expect:"); // Disable Expect: 100-continue
120120
}
121121

122+
/* set HTTP headers for request */
123+
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers_chunk);
124+
122125
res = curl_easy_perform(curl);
123126

124127
curl_slist_free_all(headers_chunk);

0 commit comments

Comments
 (0)