mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Make http::build_url work correctly
This commit is contained in:
parent
1f9bdceaaf
commit
6ba1d1dcd3
1 changed files with 6 additions and 2 deletions
|
@ -55,9 +55,13 @@ function extract_keys(data: string, kv_splitter: pattern): string_vec
|
||||||
function build_url(rec: Info): string
|
function build_url(rec: Info): string
|
||||||
{
|
{
|
||||||
local uri = rec?$uri ? rec$uri : "/<missed_request>";
|
local uri = rec?$uri ? rec$uri : "/<missed_request>";
|
||||||
|
if ( strstr(uri, "://") != 0 )
|
||||||
|
return uri;
|
||||||
|
|
||||||
local host = rec?$host ? rec$host : addr_to_uri(rec$id$resp_h);
|
local host = rec?$host ? rec$host : addr_to_uri(rec$id$resp_h);
|
||||||
if ( rec$id$resp_p != 80/tcp )
|
local resp_p = port_to_count(rec$id$resp_p);
|
||||||
host = fmt("%s:%s", host, rec$id$resp_p);
|
if ( resp_p != 80 )
|
||||||
|
host = fmt("%s:%s", host, resp_p);
|
||||||
return fmt("%s%s", host, uri);
|
return fmt("%s%s", host, uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue