diff options
author | Matthew Wild <mwild1@gmail.com> | 2009-01-12 04:02:29 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2009-01-12 04:02:29 +0000 |
commit | e50d22fcc44c67d513e6b527305134831bdd327b (patch) | |
tree | e74775e00f4a77b3fa017d1c7f58cec44d6ee508 /net/httpserver.lua | |
parent | 05fe5fb8ffc714ff8b996c0f31dd830193688290 (diff) | |
download | prosody-e50d22fcc44c67d513e6b527305134831bdd327b.tar.gz prosody-e50d22fcc44c67d513e6b527305134831bdd327b.zip |
core.httpserver: Rename request.responseheaders to the more logical request.headers
Diffstat (limited to 'net/httpserver.lua')
-rw-r--r-- | net/httpserver.lua | 6 |
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); |