diff options
author | Luca Deri <lucaderi@users.noreply.github.com> | 2020-05-14 20:56:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-14 20:56:07 +0200 |
commit | 7037e796048d84be01d8cf96891a977b898e6c19 (patch) | |
tree | 353c0718fd8d04f0aafcba86b5d1670ba8fa02de /src/lib/ndpi_main.c | |
parent | fb64346e28633055dac543bc0ef6f3c406d5bbd5 (diff) | |
parent | 1edf5c49d662f7944ee976a63d54980a270a2419 (diff) |
Merge pull request #903 from Loures/dev
Extend packet struct with Content-Disposition HTTP header field
Diffstat (limited to 'src/lib/ndpi_main.c')
-rw-r--r-- | src/lib/ndpi_main.c | 7 |
1 files changed, 7 insertions, 0 deletions
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) { |