diff options
author | Luca <deri@ntop.org> | 2019-10-31 09:15:57 +0100 |
---|---|---|
committer | Luca <deri@ntop.org> | 2019-10-31 09:15:57 +0100 |
commit | e272db0f7fb0c599355e7a5aae993aea3c30db60 (patch) | |
tree | ac50694a23f466607e4d1b6dcfd48cf807beef49 /src | |
parent | cb79d89f833f4a4d8b4ef237a504a7a79d3f6bd1 (diff) |
content type parsing fix
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/ndpi_main.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c index 897f16492..7a2d5a01e 100644 --- a/src/lib/ndpi_main.c +++ b/src/lib/ndpi_main.c @@ -5092,9 +5092,13 @@ void ndpi_parse_packet_line_info(struct ndpi_detection_module_struct *ndpi_str, if(packet->content_line.len > 0) { /* application/json; charset=utf-8 */ - char *c = strchr((char*)packet->content_line.ptr, ';'); + char separator[] = { ';', '\r', '\0' }; + int i; - if(c != NULL) { + for(i=0; separator[i] != '\0'; i++) { + char *c = strchr((char*)packet->content_line.ptr, separator[i]); + + if(c != NULL) packet->content_line.len = c - (char*)packet->content_line.ptr; } } |