1
0
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:
nnposter
2017-04-19 18:39:20 +00:00
parent ab96f9c2e7
commit cfa57758ad

View File

@@ -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,
}