mirror of
https://github.com/nmap/nmap.git
synced 2025-12-17 13:09:02 +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
|
-- make sure we're actually being redirected somewhere and not to the same url
|
||||||
function (url, host, port)
|
function (url, host, port)
|
||||||
|
-- url.path must be set if returning true
|
||||||
-- path cannot be unchanged unless host has changed
|
-- path cannot be unchanged unless host has changed
|
||||||
-- loc.path must be set if returning true
|
-- TODO: Since we do not know here what the actual old path was then
|
||||||
if ( not url.path or url.path == "/" ) and url.host == ( host.targetname or host.ip) then return false end
|
-- the effectiveness of this code is a bit unclear.
|
||||||
if not url.path then return true end
|
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
|
return true
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user