Skip to content
Closed
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
15 changes: 15 additions & 0 deletions src/http_server/flb_http_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,21 @@ int flb_http_server_session_ingest(struct flb_http_server_session *session,
if (result != 0) {
return -1;
}

if (strstr(session->incoming_data,
"User-Agent: curl") != NULL) {
/* FIXME: Auto disabling keepalive for curl requests due to not return responses
* when enabled to HTTP/1.1 with keepalive. This should be harmful
* for splunk input case. This is because Splunk HEC
* requests are expected to return response code response
* with JSON representation. Meanwhile, we need to
* disable keepalive automatically in this code path. */
if (session->version == HTTP_PROTOCOL_HTTP1) {
if (session->parent->flags & FLB_HTTP_SERVER_FLAG_KEEPALIVE) {
session->parent->flags &= ~FLB_HTTP_SERVER_FLAG_KEEPALIVE;
}
}
}
}
else if (session->version == HTTP_PROTOCOL_HTTP2) {
result = flb_http2_server_session_init(&session->http2, session);
Expand Down