瀏覽代碼

matching of mime type in http request header that contain a charset appendix

Lukas Humbel 8 年之前
父節點
當前提交
02832a1a45
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      httpserver-request.lua

+ 1 - 1
httpserver-request.lua

@@ -51,7 +51,7 @@ local function getRequestData(payload)
     if requestData then
       return requestData
     else
-      local mimeType = string.match(payload, "Content%-Type: (%S+)\r\n")
+      local mimeType = string.match(payload, "Content%-Type: ([%w/-]+)")
       local body_start = payload:find("\r\n\r\n", 1, true)
       local body = payload:sub(body_start, #payload)
       payload = nil