1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-07 13:11:28 +00:00

Fixed a bug in http-auth that failed to report errors properly.

This commit is contained in:
patrik
2012-01-28 18:13:15 +00:00
parent 9cf2fa8854
commit fb3eb4c6c5

View File

@@ -58,13 +58,13 @@ action = function(host, port)
www_authenticate = answer.header["www-authenticate"]
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)
end
challenges = http.parse_www_authenticate(www_authenticate)
if not challenges then
table.insert( ("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, ("Server returned status %d but the WWW-Authenticate header could not be parsed."):format(answer.status) )
table.insert( result, ("WWW-Authenticate: %s"):format(www_authenticate) )
return stdnse.format_output(true, result)
end
@@ -78,6 +78,5 @@ action = function(host, port)
table.insert(result, line)
end
--return table.concat(result, "\n")
return stdnse.format_output(true, result)
end