Skip to content

Commit

Permalink
Updated application/json Content-Type header detect to allow detectin…
Browse files Browse the repository at this point in the history
…g application/json when length is longer than 16 character because of addition encoding in the header value, aka 'Content-type: application/json; charset=utf-8'

Signed-off-by: metalfork <[email protected]>
  • Loading branch information
metalfork committed Jul 1, 2024
1 parent 13f96f9 commit d18ea2b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/in_http/http_prot.c
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ static int process_payload(struct flb_http *ctx, struct http_conn *conn,
return -1;
}

if (header->val.len == 16 &&
if (header->val.len >= 16 &&
strncasecmp(header->val.data, "application/json", 16) == 0) {
type = HTTP_CONTENT_JSON;
}
Expand Down

0 comments on commit d18ea2b

Please sign in to comment.