mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-30 16:09:32 +00:00
Fix hostname validation in URI
This commit is contained in:
parent
423b596f52
commit
4ca5eb238e
2 changed files with 7 additions and 1 deletions
|
|
@ -26,6 +26,12 @@ if isEmptyString(hostname) then
|
|||
return
|
||||
end
|
||||
|
||||
if string.find(hostname, '://') then
|
||||
-- Looks like an URI, strip the scheme
|
||||
local uri_info = string.split(hostname, "://")
|
||||
hostname = uri_info[2]
|
||||
end
|
||||
|
||||
local resolved = ntop.resolveHost(hostname, true --[[ IPv4 --]])
|
||||
if not resolved then
|
||||
resolved = ntop.resolveHost(hostname, false --[[ IPv6 --]])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue