1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-06 06:29:03 +00:00

Export http.parse_redirect, a useful function

This commit is contained in:
dmiller
2014-09-17 21:57:57 +00:00
parent 5c9d6a3a75
commit 440ed59396

View File

@@ -1389,14 +1389,14 @@ function redirect_ok(host, port)
end
end
-- Handles a HTTP redirect
--- Handles a HTTP redirect
-- @param host table as received by the script action function
-- @param port table as received by the script action function
-- @param path string
-- @param response table as returned by http.get or http.head
-- @return url table as returned by <code>url.parse</code> or nil if there's no
-- redirect taking place
local function parse_redirect(host, port, path, response)
function parse_redirect(host, port, path, response)
if ( not(tostring(response.status):match("^30[01237]$")) or
not(response.header) or
not(response.header.location) ) then