From d5748b1d83c4e140b80735ce6746ce9df0ae88c0 Mon Sep 17 00:00:00 2001 From: batrick Date: Sat, 15 Aug 2009 14:53:28 +0000 Subject: [PATCH] If the response is already a table (from an error in http.request) then do not try to parse a result, instead return nil. This fixes an error where we try to index match as though response is a string. --- nselib/http.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/nselib/http.lua b/nselib/http.lua index 34d1744ed..ad924396f 100644 --- a/nselib/http.lua +++ b/nselib/http.lua @@ -781,6 +781,7 @@ end -- @param response A response received from the server for a request -- @return A table with the values received from the server function parseResult( response ) + if type(response) ~= "string" then return response end local result = {status=nil,["status-line"]=nil,header={},body=""} -- try and separate the head from the body