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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user