浏览代码

Update httpserver-header.lua

TJ Borromeo 9 年之前
父节点
当前提交
219baa7b62
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      httpserver-header.lua

+ 2 - 1
httpserver-header.lua

@@ -7,7 +7,8 @@ return function (connection, code, extension)
    local function getHTTPStatusString(code)
       local codez = {[200]="OK", [400]="Bad Request", [404]="Not Found", [501]="Not Implemented",}
       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 codez[501] end
    end
 
    local function getMimeType(ext)