mirror of
https://github.com/nmap/nmap.git
synced 2025-12-15 20:29:03 +00:00
Changes the redirect rule to return false in case of a missing path. This
change aligns the code with the corresponding comment. Fixes #830
This commit is contained in:
@@ -1518,10 +1518,12 @@ local redirect_ok_rules = {
|
||||
|
||||
-- make sure we're actually being redirected somewhere and not to the same url
|
||||
function (url, host, port)
|
||||
-- url.path must be set if returning true
|
||||
-- path cannot be unchanged unless host has changed
|
||||
-- loc.path must be set if returning true
|
||||
if ( not url.path or url.path == "/" ) and url.host == ( host.targetname or host.ip) then return false end
|
||||
if not url.path then return true end
|
||||
-- TODO: Since we do not know here what the actual old path was then
|
||||
-- the effectiveness of this code is a bit unclear.
|
||||
if not url.path then return false end
|
||||
if url.path == "/" and url.host == (host.targetname or host.ip) then return false end
|
||||
return true
|
||||
end,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user