function Redirect.handle_GET(self, request)
local target = self.target
local protocol = request.env.HTTPS and "https://" or "http://"
- local server
+ local server = request.env.SERVER_ADDR
if request.env.REMOTE_ADDR and not request.env.REMOTE_ADDR:find(":") then
local compare = ip.IPv4(request.env.REMOTE_ADDR)
end
end
end
- else
- server = request.env.SERVER_ADDR
end
+
if server:find(":") then
server = "[" .. server .. "]"
end
function Redirect.handle_HEAD(self, request)
local stat, head = self:handle_GET(request)
return stat, head
-end
\ No newline at end of file
+end