aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2009-01-13 15:29:00 +0000
committerMatthew Wild <mwild1@gmail.com>2009-01-13 15:29:00 +0000
commit4dc4d175d135e293f48ed6a15f61b19c4dafe8d7 (patch)
treec4a1aeb92f7ccaccc8fd919d065d3add4c71c12d /net
parentbb7d8604f252ce84bdea1cb791114dfc40c5a958 (diff)
parent8b979ccaf40ae38dbeaa5e7a4edb2e6d760fdffa (diff)
downloadprosody-4dc4d175d135e293f48ed6a15f61b19c4dafe8d7.tar.gz
prosody-4dc4d175d135e293f48ed6a15f61b19c4dafe8d7.zip
Automated merge with http://waqas.ath.cx:8000/
Diffstat (limited to 'net')
-rw-r--r--net/httpserver.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/httpserver.lua b/net/httpserver.lua
index 3a3c34b4..b9ac7971 100644
--- a/net/httpserver.lua
+++ b/net/httpserver.lua
@@ -126,7 +126,7 @@ local function request_reader(request, data, startpos)
end
if request.state == "body" then
log("debug", "Reading body...")
- if not request.body then request.body = {}; request.havebodylength, request.bodylength = 0, tonumber(request.responseheaders["content-length"]); end
+ if not request.body then request.body = {}; request.havebodylength, request.bodylength = 0, tonumber(request.headers["content-length"]); end
if startpos then
data = data:sub(startpos, -1)
end
@@ -141,7 +141,7 @@ local function request_reader(request, data, startpos)
elseif request.state == "headers" then
log("debug", "Reading headers...")
local pos = startpos;
- local headers = request.responseheaders or {};
+ local headers = request.headers or {};
for line in data:gmatch("(.-)\r\n") do
startpos = (startpos or 1) + #line + 2;
local k, v = line:match("(%S+): (.+)");
@@ -149,7 +149,7 @@ local function request_reader(request, data, startpos)
headers[k:lower()] = v;
-- log("debug", "Header: "..k:lower().." = "..v);
elseif #line == 0 then
- request.responseheaders = headers;
+ request.headers = headers;
break;
else
log("debug", "Unhandled header line: "..line);