aboutsummaryrefslogtreecommitdiff
path: root/src/lib/protocols/http.c
diff options
context:
space:
mode:
authorLuca Deri <deri@ntop.org>2019-10-01 12:25:39 +0200
committerLuca Deri <deri@ntop.org>2019-10-01 12:25:39 +0200
commite45237a93f771f3d4aeb6c2360469f09c0282b58 (patch)
tree59b012693a1a66cbb493b0830f8ba61169aaf9bc /src/lib/protocols/http.c
parenta62cf102331653119b83e87d2efdef6d11cefcd1 (diff)
Removed http:// from HTTP url
Reported URL in ndpiReader
Diffstat (limited to 'src/lib/protocols/http.c')
-rw-r--r--src/lib/protocols/http.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/lib/protocols/http.c b/src/lib/protocols/http.c
index a118477c5..cc27b8eb6 100644
--- a/src/lib/protocols/http.c
+++ b/src/lib/protocols/http.c
@@ -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';
}