mirror of
https://github.com/nmap/nmap.git
synced 2025-12-07 21:21:31 +00:00
Fix NSEdoc generation problem
@field tag names in NSEdoc must be valid identifiers, so they cannot contain "-". As a general rule, anything that needs to be quoted like this: mytable["field-name"] is invalid. In this case, the ajp library had a field called "status-line", which caused NSEdoc generation to fail when it was finally documented. This change renames it to "status_line", which should fix the issue.
This commit is contained in:
@@ -219,7 +219,7 @@ AJP = {
|
|||||||
pos, sh.status = bin.unpack(">S", data, pos)
|
pos, sh.status = bin.unpack(">S", data, pos)
|
||||||
pos, status_msg = bin.unpack(">P", data, pos)
|
pos, status_msg = bin.unpack(">P", data, pos)
|
||||||
pos = pos + 1
|
pos = pos + 1
|
||||||
sh['status-line'] = ("AJP/1.3 %d %s"):format(sh.status, status_msg)
|
sh.status_line = ("AJP/1.3 %d %s"):format(sh.status, status_msg)
|
||||||
|
|
||||||
pos, hdr_count = bin.unpack(">S", data, pos)
|
pos, hdr_count = bin.unpack(">S", data, pos)
|
||||||
|
|
||||||
@@ -301,7 +301,7 @@ Comm = {
|
|||||||
-- @class table
|
-- @class table
|
||||||
-- @name ajp.response
|
-- @name ajp.response
|
||||||
-- @field status status of response (see HTTP status codes)
|
-- @field status status of response (see HTTP status codes)
|
||||||
-- @field status-line the complete status line (eg. 200 OK)
|
-- @field status_line the complete status line (eg. 200 OK)
|
||||||
-- @field body the response body as string
|
-- @field body the response body as string
|
||||||
-- @field headers table of response headers
|
-- @field headers table of response headers
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ action = function(host, port)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local result = { name = answer["status-line"]:match("^(.*)\r?\n$") }
|
local result = { name = answer.status_line:match("^(.*)\r?\n$") }
|
||||||
|
|
||||||
local www_authenticate = answer.headers["www-authenticate"]
|
local www_authenticate = answer.headers["www-authenticate"]
|
||||||
if not www_authenticate then
|
if not www_authenticate then
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ action = function(host, port)
|
|||||||
helper:close()
|
helper:close()
|
||||||
|
|
||||||
if ( response ) then
|
if ( response ) then
|
||||||
local output = response['status-line'] .. "\n" ..
|
local output = response.status_line .. "\n" ..
|
||||||
stdnse.strjoin("\n", response.rawheaders) ..
|
stdnse.strjoin("\n", response.rawheaders) ..
|
||||||
(response.body and "\n\n" .. response.body or "")
|
(response.body and "\n\n" .. response.body or "")
|
||||||
if ( arg_file ) then
|
if ( arg_file ) then
|
||||||
|
|||||||
Reference in New Issue
Block a user