Changeset 6624

Show
Ignore:
Timestamp:
12/05/10 19:22:30 (2 years ago)
Author:
jow
Message:

libs/httpclient: fix cookie handling (#141)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • luci/trunk/libs/httpclient/luasrc/httpclient.lua

    r5607 r6624  
    195195            local cpa = c.flags.path 
    196196            if   (cdo == host or cdo == "."..host or host:sub(-#cdo) == cdo)  
    197              and (cpa == "/" or cpa .. "/" == path:sub(#cpa+1)) 
     197             and (cpa == path or cpa == "/" or cpa .. "/" == path:sub(#cpa+1)) 
    198198             and (not c.flags.secure or pr == "https") 
    199199            then 
     
    243243        local key, val = line:match("^([%w-]+)%s?:%s?(.*)") 
    244244        if key and key ~= "Status" then 
    245             if type(response[key]) == "string" then 
     245            if type(response.headers[key]) == "string" then 
    246246                response.headers[key] = {response.headers[key], val} 
    247             elseif type(response[key]) == "table" then 
     247            elseif type(response.headers[key]) == "table" then 
    248248                response.headers[key][#response.headers[key]+1] = val 
    249249            else