mirror of
https://github.com/nmap/nmap.git
synced 2025-12-31 20:09:02 +00:00
Honor the options table in http.request (specifically options.timeout).
I think this was supposed to work but it was broken.
This commit is contained in:
@@ -940,12 +940,13 @@ end
|
||||
-- * <code>cookies</code>: A table of cookies in the form returned by <code>parse_set_cookie</code>.
|
||||
-- @return A table as described in the module description.
|
||||
-- @see generic_request
|
||||
request = function(host, port, data)
|
||||
request = function(host, port, data, options)
|
||||
local method
|
||||
local opts
|
||||
local header, partial
|
||||
local response
|
||||
|
||||
options = options or {}
|
||||
|
||||
if type(host) == 'table' then
|
||||
host = host.ip
|
||||
end
|
||||
@@ -962,7 +963,7 @@ request = function(host, port, data)
|
||||
|
||||
method = string.match(data, "^(%S+)")
|
||||
|
||||
socket, partial = comm.tryssl(host, port, data, opts)
|
||||
socket, partial = comm.tryssl(host, port, data, { timeout = options.timeout })
|
||||
|
||||
if not socket then
|
||||
return error_response
|
||||
|
||||
Reference in New Issue
Block a user