mirror of
https://github.com/nmap/nmap.git
synced 2025-12-09 14:11:29 +00:00
Fixed a bug in http-auth that failed to report errors properly.
This commit is contained in:
@@ -58,13 +58,13 @@ action = function(host, port)
|
|||||||
|
|
||||||
www_authenticate = answer.header["www-authenticate"]
|
www_authenticate = answer.header["www-authenticate"]
|
||||||
if not www_authenticate then
|
if not www_authenticate then
|
||||||
table.insert( ("Server returned status %d but no WWW-Authenticate header."):format(answer.status) )
|
table.insert( result, ("Server returned status %d but no WWW-Authenticate header."):format(answer.status) )
|
||||||
return stdnse.format_output(true, result)
|
return stdnse.format_output(true, result)
|
||||||
end
|
end
|
||||||
challenges = http.parse_www_authenticate(www_authenticate)
|
challenges = http.parse_www_authenticate(www_authenticate)
|
||||||
if not challenges then
|
if not challenges then
|
||||||
table.insert( ("Server returned status %d but the WWW-Authenticate header could not be parsed."):format(answer.status) )
|
table.insert( result, ("Server returned status %d but the WWW-Authenticate header could not be parsed."):format(answer.status) )
|
||||||
table.insert( ("WWW-Authenticate: %s"):format(www_authenticate) )
|
table.insert( result, ("WWW-Authenticate: %s"):format(www_authenticate) )
|
||||||
return stdnse.format_output(true, result)
|
return stdnse.format_output(true, result)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -78,6 +78,5 @@ action = function(host, port)
|
|||||||
table.insert(result, line)
|
table.insert(result, line)
|
||||||
end
|
end
|
||||||
|
|
||||||
--return table.concat(result, "\n")
|
|
||||||
return stdnse.format_output(true, result)
|
return stdnse.format_output(true, result)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user