From baddfbb6c3d09398b207248c64dc8fe6d5568ee6 Mon Sep 17 00:00:00 2001 From: loures Date: Thu, 14 May 2020 12:42:42 +0200 Subject: Extend packet struct with Content-Disposition HTTP header field and improve HTTP binary transfer mime type check --- src/lib/ndpi_main.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/lib/ndpi_main.c') diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c index dcb34f2ad..59d4f3491 100644 --- a/src/lib/ndpi_main.c +++ b/src/lib/ndpi_main.c @@ -4960,6 +4960,13 @@ void ndpi_parse_packet_line_info(struct ndpi_detection_module_struct *ndpi_str, packet->http_contentlen.len = packet->line[packet->parsed_lines].len - 16; packet->http_num_headers++; } + /* "Content-Disposition"*/ + if(packet->line[packet->parsed_lines].len > 21 && + ((strncasecmp((const char *) packet->line[packet->parsed_lines].ptr, "Content-Disposition: ", 21) == 0))) { + packet->content_disposition_line.ptr = &packet->line[packet->parsed_lines].ptr[21]; + packet->content_disposition_line.len = packet->line[packet->parsed_lines].len - 21; + packet->http_num_headers++; + } /* "Cookie:" header line in HTTP. */ if(packet->line[packet->parsed_lines].len > 8 && strncasecmp((const char *) packet->line[packet->parsed_lines].ptr, "Cookie: ", 8) == 0) { -- cgit v1.2.3