Skip to content

Disable Expect when sending audit logs to remote HTTP server #3365

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: v3/master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/utils/https_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,18 @@ bool HttpsClient::download(const std::string &uri) {
curl_easy_setopt(curl, CURLOPT_WRITEDATA, this);

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 */
curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1);

if (m_requestBody.empty() == false) {
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);

curl_slist_free_all(headers_chunk);
Expand Down
Loading