1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-09 22:21:29 +00:00

Added the status code to the rawheaders as well (so it's displayed in http-headers.nse). Also updated the @output in the nsedoc.

This commit is contained in:
ron
2009-08-27 15:47:10 +00:00
parent 62dedb9dc1
commit 7da313e8ac
2 changed files with 10 additions and 12 deletions

View File

@@ -967,6 +967,9 @@ function parseResult( response )
-- build nicer table for header
local last_header, match, key
for number, line in ipairs( header or {} ) do
-- Keep the raw header too, in case a script wants to access it
table.insert(result['rawheader'], line)
if number == 1 then
local code = line:match "HTTP/%d%.%d (%d+)";
result.status = tonumber(code)
@@ -974,8 +977,6 @@ function parseResult( response )
else
match, _, key, value = string.find( line, "(.+): (.*)" )
if match and key and value then
-- Keep the raw header too, in case a script wants to access it
table.insert(result['rawheader'], line)
key = key:lower()
if result.header[key] then
result.header[key] = result.header[key] .. ',' .. value