1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-21 06:59:01 +00:00

Removes parse_url from http.lua and makes url.parse more functional. Closes #952.

This commit is contained in:
rewanth
2017-08-14 20:30:57 +00:00
parent 011e65c1b7
commit c2a9a5bbe3
4 changed files with 109 additions and 97 deletions

View File

@@ -29,6 +29,7 @@ local target = require "target"
local shortport = require "shortport"
local httpspider = require "httpspider"
local stdnse = require "stdnse"
local url = require "url"
getLastLoc = function(host, port, useragent)
@@ -71,7 +72,7 @@ action = function(host, port)
-- If the mobile browser request is redirected to a different page, that must be the mobile version's page.
if loc ~= mobloc then
local msg = "Found mobile version: " .. mobloc
local mobhost = http.parse_url(mobloc)
local mobhost = url.parse(mobloc)
if not crawler:iswithinhost(mobhost.host) then
msg = msg .. " (Redirected to a different host)"
if newtargets then