use table for multi header key

This commit is contained in:
Cloud Wu
2015-03-16 20:01:22 +08:00
parent c287f050c1
commit 92b7b7beff
2 changed files with 17 additions and 2 deletions

View File

@@ -1,3 +1,6 @@
local table = table
local type = type
local M = {}
local LIMIT = 8192
@@ -83,7 +86,12 @@ function M.parseheader(lines, from, header)
end
name = name:lower()
if header[name] then
header[name] = header[name] .. ", " .. value
local v = header[name]
if type(v) == "table" then
table.insert(v, value)
else
header[name] = { v , value }
end
else
header[name] = value
end