Changeset 4324
- Timestamp:
- 03/12/09 21:14:55 (4 years ago)
- Files:
-
- 1 modified
-
luci/trunk/libs/httpclient/luasrc/httpclient.lua (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
luci/trunk/libs/httpclient/luasrc/httpclient.lua
r4313 r4324 224 224 end 225 225 226 local response = {status = line, headers = {}, code = 0, cookies = {}} 226 local response = { 227 status = line, headers = {}, code = 0, cookies = {}, uri = uri 228 } 227 229 228 230 line = linesrc() … … 293 295 if response.code == 301 or response.code == 302 or response.code == 307 294 296 and response.headers.Location then 295 local nexturi = response.headers.Location 296 if not nexturi:find("https?://") then 297 nexturi = pr .. "://" .. host .. ":" .. port .. nexturi 297 local nuri = response.headers.Location or response.headers.location 298 if not nuri then 299 return nil, -5, "invalid reference" 300 end 301 if not nuri:find("https?://") then 302 nuri = pr .. "://" .. host .. ":" .. port .. nuri 298 303 end 299 304 … … 301 306 sock:close() 302 307 303 return request_raw(n exturi, options)308 return request_raw(nuri, options) 304 309 end 305 310 end
