瀏覽代碼

Merge pull request #21 from borromeotlhs/patch-4

Fix improper syntax in list
Marcos 9 年之前
父節點
當前提交
94c56a02b9
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      httpserver-header.lua

+ 3 - 2
httpserver-header.lua

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