Skip to content

Commit

Permalink
parser_decoder: remove json validation (#691)
Browse files Browse the repository at this point in the history
Signed-off-by: Eduardo Silva <[email protected]>
  • Loading branch information
edsiper committed Aug 6, 2018
1 parent d137d52 commit d4c6da5
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/flb_parser_decoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,15 +241,8 @@ static int decode_json(struct flb_parser_dec *dec,
/* JSON Decoder: content may be escaped */
len = unescape_string(in_buf, in_size, &dec->buffer);

/* Is it JSON valid ? (pre validation to avoid mem allocation on tokens */
ret = flb_pack_json_valid(dec->buffer, len);
if (ret == -1) {
/* Invalid or no JSON Message */
return -1;
}

/* It must be a map */
if (dec->buffer[0] != '{') {
/* It must be a map or array */
if (dec->buffer[0] != '{' && dec->buffer[0] != '[') {
return -1;
}

Expand Down

0 comments on commit d4c6da5

Please sign in to comment.