소스 검색

change return type

allows the error check to be more functional
TJ Borromeo 9 년 전
부모
커밋
0c17703b46
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      httpserver-header.lua

+ 1 - 1
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)