From e4d923f0760e074df7e6649247cdd94c888c884e Mon Sep 17 00:00:00 2001 From: nnposter Date: Sat, 1 Apr 2017 22:33:37 +0000 Subject: [PATCH] Allows the port to be a simple number --- nselib/http.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nselib/http.lua b/nselib/http.lua index 90e793cca..7c81ab8d4 100644 --- a/nselib/http.lua +++ b/nselib/http.lua @@ -161,7 +161,9 @@ end -- See RFC 2616 sections 14.23 and 5.2. local function get_host_field(host, port) if not host then return nil end - port = type(port) == "number" and {number=port} or port + if type(port) == "number" then + port = {number=port, protocol="tcp", state="open", version={}} + end local ssl = shortport.ssl(host, port) local pn = port.number if not ssl and pn == 80 or ssl and pn == 443 then