[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Question about LuaSocket : Always receive Http Error:Number 302
- From: Petite Abeille <petite.abeille@...>
- Date: Wed, 26 May 2010 20:06:39 +0200
On May 26, 2010, at 5:13 PM, 木村 圭佑 wrote:
> redirect = true
> }
http.lua should handle redirect automatically if instructed to do so, as you have.
In http.lua:
local function shouldredirect(reqt, code, headers)
return headers.location and
string.gsub(headers.location, "%s", "") ~= "" and
(reqt.redirect ~= false) and
(code == 301 or code == 302 or code == 303 or code == 307) and
(not reqt.method or reqt.method == "GET" or reqt.method == "HEAD")
and (not reqt.nredirects or reqt.nredirects < 5)
end