function Redirect.handle_GET(self, request)
local target = self.target
local protocol = request.env.HTTPS and "https://" or "http://"
function Redirect.handle_GET(self, request)
local target = self.target
local protocol = request.env.HTTPS and "https://" or "http://"
if request.env.REMOTE_ADDR and not request.env.REMOTE_ADDR:find(":") then
local compare = ip.IPv4(request.env.REMOTE_ADDR)
if request.env.REMOTE_ADDR and not request.env.REMOTE_ADDR:find(":") then
local compare = ip.IPv4(request.env.REMOTE_ADDR)
function Redirect.handle_HEAD(self, request)
local stat, head = self:handle_GET(request)
return stat, head
function Redirect.handle_HEAD(self, request)
local stat, head = self:handle_GET(request)
return stat, head