mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-01 00:19:33 +00:00
Support also port in uri when validating hosts
This commit is contained in:
parent
806dfb3e19
commit
fdd9a8f399
1 changed files with 11 additions and 1 deletions
|
|
@ -29,7 +29,17 @@ end
|
|||
if string.find(hostname, '://') then
|
||||
-- Looks like an URI, strip the scheme
|
||||
local uri_info = string.split(hostname, "://")
|
||||
hostname = uri_info[2]
|
||||
if #uri_info == 2 then
|
||||
hostname = uri_info[2]
|
||||
end
|
||||
end
|
||||
|
||||
if string.find(hostname, ':') then
|
||||
local host_port_info = string.split(hostname, ":")
|
||||
if #host_port_info == 2 then
|
||||
-- Looks like host:port, strip the port
|
||||
hostname = host_port_info[1]
|
||||
end
|
||||
end
|
||||
|
||||
local resolved = ntop.resolveHost(hostname, true --[[ IPv4 --]])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue