projects
/
project
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2466034
)
libs/httpclient: fix cookie handling (#141)
author
Jo-Philipp Wich
<jow@openwrt.org>
Sun, 5 Dec 2010 18:22:30 +0000
(18:22 +0000)
committer
Jo-Philipp Wich
<jow@openwrt.org>
Sun, 5 Dec 2010 18:22:30 +0000
(18:22 +0000)
libs/httpclient/luasrc/httpclient.lua
patch
|
blob
|
history
diff --git
a/libs/httpclient/luasrc/httpclient.lua
b/libs/httpclient/luasrc/httpclient.lua
index
1f0e55b
..
aacc79a
100644
(file)
--- a/
libs/httpclient/luasrc/httpclient.lua
+++ b/
libs/httpclient/luasrc/httpclient.lua
@@
-194,7
+194,7
@@
function request_raw(uri, options)
local cdo = c.flags.domain
local cpa = c.flags.path
if (cdo == host or cdo == "."..host or host:sub(-#cdo) == cdo)
local cdo = c.flags.domain
local cpa = c.flags.path
if (cdo == host or cdo == "."..host or host:sub(-#cdo) == cdo)
- and (cpa == "/" or cpa .. "/" == path:sub(#cpa+1))
+ and (cpa ==
path or cpa ==
"/" or cpa .. "/" == path:sub(#cpa+1))
and (not c.flags.secure or pr == "https")
then
message[#message+1] = "Cookie: " .. c.key .. "=" .. c.value
and (not c.flags.secure or pr == "https")
then
message[#message+1] = "Cookie: " .. c.key .. "=" .. c.value
@@
-242,9
+242,9
@@
function request_raw(uri, options)
while line and line ~= "" do
local key, val = line:match("^([%w-]+)%s?:%s?(.*)")
if key and key ~= "Status" then
while line and line ~= "" do
local key, val = line:match("^([%w-]+)%s?:%s?(.*)")
if key and key ~= "Status" then
- if type(response[key]) == "string" then
+ if type(response
.headers
[key]) == "string" then
response.headers[key] = {response.headers[key], val}
response.headers[key] = {response.headers[key], val}
- elseif type(response[key]) == "table" then
+ elseif type(response
.headers
[key]) == "table" then
response.headers[key][#response.headers[key]+1] = val
else
response.headers[key] = val
response.headers[key][#response.headers[key]+1] = val
else
response.headers[key] = val