aboutsummaryrefslogtreecommitdiffstats
path: root/net/httpserver.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2010-08-28 23:41:09 +0100
committerMatthew Wild <mwild1@gmail.com>2010-08-28 23:41:09 +0100
commitfc62af2024baf14005057460d028d97f4147767a (patch)
treeea7535f73c41a28554cf372d5fc278026ade18c0 /net/httpserver.lua
parentbe6148a1eb775be9a5169e00bdf5365051eb20d1 (diff)
downloadprosody-fc62af2024baf14005057460d028d97f4147767a.tar.gz
prosody-fc62af2024baf14005057460d028d97f4147767a.zip
net.httpserver: Join multiple headers with the same name as per RFC (thanks darkhippo)
Diffstat (limited to 'net/httpserver.lua')
-rw-r--r--net/httpserver.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/net/httpserver.lua b/net/httpserver.lua
index 59ddbb12..55758147 100644
--- a/net/httpserver.lua
+++ b/net/httpserver.lua
@@ -152,7 +152,12 @@ local function request_reader(request, data, startpos)
startpos = (startpos or 1) + #line + 2;
local k, v = line:match("(%S+): (.+)");
if k and v then
- headers[k:lower()] = v;
+ k = k:lower();
+ if headers[k] then
+ headers[k] = headers[k]..", "..v;
+ else
+ headers[k] = v;
+ end
--log("debug", "Header: '"..k:lower().."' = '"..v.."'");
elseif #line == 0 then
headers_complete = true;