change return type

allows the error check to be more functional
This commit is contained in:
TJ Borromeo 2015-05-06 13:39:32 -07:00
parent 219baa7b62
commit 0c17703b46

View File

@ -8,7 +8,7 @@ return function (connection, code, extension)
local codez = {[200]="OK", [400]="Bad Request", [404]="Not Found", [501]="Not Implemented",} local codez = {[200]="OK", [400]="Bad Request", [404]="Not Found", [501]="Not Implemented",}
local myResult = codez[code] local myResult = codez[code]
-- enforce returning valid http codes all the way throughout? -- 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 end
local function getMimeType(ext) local function getMimeType(ext)