Keep return type as is

No need for 501 error code, as this should be returned only when needed, and will be much more efficient to not:
1.) take a table entry for the majority of cases when it isn't needed
2.) Utilize only enough memory needed to instantiate a string when it _is_ needed.
This commit is contained in:
TJ Borromeo 2015-05-06 13:54:21 -07:00
parent e01e97469f
commit 2672d3b467

View File

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