Skip to content

Commit

Permalink
in_splunk: Check credential properly for HTTP2 payloads
Browse files Browse the repository at this point in the history
Signed-off-by: Hiroshi Hatake <[email protected]>
  • Loading branch information
cosmo0920 committed Jun 5, 2024
1 parent a77b7a2 commit 1888a1b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions plugins/in_splunk/splunk_prot.c
Original file line number Diff line number Diff line change
Expand Up @@ -999,8 +999,10 @@ static int process_hec_payload_ng(struct flb_http_request *request,
}

ret = flb_hash_table_get(request->headers, "authorization", 13, (void **)&auth_header, &size);
if (ret != 0) {
ctx->ingested_auth_header = auth_header;
if (ret != 0 && size > 0) {
if (strncasecmp(auth_header, "Splunk ", 7) == 0) {
ctx->ingested_auth_header = auth_header;
}
}

if (request->body == NULL || cfl_sds_len(request->body) <= 0) {
Expand Down Expand Up @@ -1032,8 +1034,10 @@ static int process_hec_raw_payload_ng(struct flb_http_request *request,
}

ret = flb_hash_table_get(request->headers, "authorization", 13, (void **)&auth_header, &size);
if (ret != 0) {
ctx->ingested_auth_header = auth_header;
if (ret != 0 && size > 0) {
if (strncasecmp(auth_header, "Splunk ", 7) == 0) {
ctx->ingested_auth_header = auth_header;
}
}

if (request->body == NULL || cfl_sds_len(request->body) == 0) {
Expand Down

0 comments on commit 1888a1b

Please sign in to comment.