Removed http:// from HTTP url
Reported URL in ndpiReader
This commit is contained in:
@@ -162,13 +162,12 @@ static void check_content_type_and_change_protocol(struct ndpi_detection_module_
|
||||
if((flow->http.url == NULL)
|
||||
&& (packet->http_url_name.len > 0)
|
||||
&& (packet->host_line.len > 0)) {
|
||||
int len = packet->http_url_name.len + packet->host_line.len + 7 + 1; /* "http://" */
|
||||
int len = packet->http_url_name.len + packet->host_line.len + 1;
|
||||
|
||||
flow->http.url = ndpi_malloc(len);
|
||||
if(flow->http.url) {
|
||||
strcpy(flow->http.url, "http://");
|
||||
strncpy(&flow->http.url[7], (char*)packet->host_line.ptr, packet->host_line.len);
|
||||
strncpy(&flow->http.url[7+packet->host_line.len], (char*)packet->http_url_name.ptr,
|
||||
strncpy(flow->http.url, (char*)packet->host_line.ptr, packet->host_line.len);
|
||||
strncpy(&flow->http.url[packet->host_line.len], (char*)packet->http_url_name.ptr,
|
||||
packet->http_url_name.len);
|
||||
flow->http.url[len-1] = '\0';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user