From 0c17703b464014ca655338663654cb81e5c246da Mon Sep 17 00:00:00 2001 From: TJ Borromeo Date: Wed, 6 May 2015 13:39:32 -0700 Subject: [PATCH] change return type allows the error check to be more functional --- httpserver-header.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/httpserver-header.lua b/httpserver-header.lua index 38b5b6a..599c3e5 100644 --- a/httpserver-header.lua +++ b/httpserver-header.lua @@ -8,7 +8,7 @@ return function (connection, code, extension) local codez = {[200]="OK", [400]="Bad Request", [404]="Not Found", [501]="Not Implemented",} local myResult = codez[code] -- enforce returning valid http codes all the way throughout? - if myResult then return myResult else return codez[501] end + if myResult then return {[code]=myResult,} else return {[501]=codez[501],} end end local function getMimeType(ext)