1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-27 01:49:03 +00:00

Fixed bug in redirection code reported by David. The redirect_ok function

would fail validating a location if the port passed to http.get or http.head
was a number and not a table. [Patrik]
This commit is contained in:
patrik
2012-02-11 17:50:48 +00:00
parent 48423a8a88
commit e8dad669ef
2 changed files with 8 additions and 3 deletions

View File

@@ -636,11 +636,12 @@ Crawler = {
-- were we redirected?
if ( response.location ) then
-- was the link absolute?
if ( response.location:match("^http") ) then
url = URL:new(response.location)
local link = response.location[#response.location]
if ( link:match("^http") ) then
url = URL:new(link)
-- guess not
else
url.path = response.location
url.path = link
end
end
-- if we have a response, proceed scraping it