diff options
author | Ivan Nardi <12729895+IvanNardi@users.noreply.github.com> | 2024-02-09 09:20:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-09 09:20:02 +0100 |
commit | f352e4f77b4f9523a8722b9a1702377cc0375c16 (patch) | |
tree | 2b49ba7594f5e49e2e98a02613f563defe2ab340 /src/lib/protocols/http.c | |
parent | 2abb68c8caf02ddfceb687ba097b996a855abc69 (diff) |
Improve normalization of `flow->host_server_name` (#2310)
Follow-up of 4543385d107fcc5a7e8632e35d9a60bcc40cb4f4
Remove trailing spaces for any HTTP header (we already remove leading
spaces)
We want:
* a "normalized" string in `flow->host_server_name`, but
* to parse the original string for flow risk checking
`ndpi_hostname_sni_set()` is a private function, so there is no need to
export its flags.
Diffstat (limited to 'src/lib/protocols/http.c')
-rw-r--r-- | src/lib/protocols/http.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/protocols/http.c b/src/lib/protocols/http.c index 2516f8158..8e4c60a5f 100644 --- a/src/lib/protocols/http.c +++ b/src/lib/protocols/http.c @@ -958,8 +958,8 @@ static void check_content_type_and_change_protocol(struct ndpi_detection_module_ hostname_just_set = 1; - if(ndpi_is_valid_hostname(flow->host_server_name, - strlen(flow->host_server_name)) == 0) { + if(ndpi_is_valid_hostname((char *)packet->host_line.ptr, + packet->host_line.len) == 0) { char str[128]; snprintf(str, sizeof(str), "Invalid host %s", flow->host_server_name); |