diff --git a/bbs_math.lua b/bbs_math.lua index 234b1e6..d588b01 100644 --- a/bbs_math.lua +++ b/bbs_math.lua @@ -93,7 +93,7 @@ else break end strval = string.byte(_data) - if strval == 13 or strval == 0 then + if strval == 13 or strval == 0 or strval == nil then -- ngx.say("read done") break else @@ -160,7 +160,7 @@ elseif tonumber(res) then -- The answer did not contain a number, so we're assuming it is nonsensical. else -- Tell the user to give us a sensible answer next time. - ngx.say("\r\n\rBLEEP! Try entering an actual number next time!\r\n\r") + ngx.say("\r\n\rBLEEP! Try entering an actual number next time! ", tostring(res), "\r\n\r") -- Wait for a few seconds (to slow down bots that hammer us) ngx.sleep(3) -- Exit with 403 (which is meaningless here, but the ngx.exit() function