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'
  • Loading branch information
metalfork committed Jun 28, 2024
1 parent 13f96f9 commit c1a3b36
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 c1a3b36

Please sign in to comment.