Account for new api response

This commit is contained in:
Samuel Williams 2020-12-06 23:37:41 +00:00 committed by Brandon Sturgeon
parent 96058b30d7
commit 847156a146

View File

@ -90,11 +90,11 @@ local function triggerPing()
function( body, size, headers, code )
local data = util.JSONToTable( body )
-- If response is malformed, or empty, set cfc false
if not data or data["server-is-up"] == nil then -- Can't use dot notation cuz api field has dashes >:(
if not data or data.status == nil then -- Can't use dot notation cuz api field has dashes >:(
responses.cfc = false
handleResponses()
else
responses.cfc = data["server-is-up"]
responses.cfc = data.status == "server-is-up"
handleResponses()
end
end,