Use a simpler method of getting the status.

The old way would crash if the HTTP request failed, in trying to
strsplit a nil value.
This commit is contained in:
david 2011-10-07 23:49:45 +00:00
parent ec269ece29
commit 1005f19805

View file

@ -67,7 +67,7 @@ end
function ServiceProxy:remote(req)
local httpdata = http.post(self.host, self.port, self.path, self.options, nil, req)
if stdnse.strsplit(" ", httpdata["status-line"])[2] ~= "200" then
if httpdata.status ~= 200 then
return
end
local body = httpdata["body"]