Authored by jie

去除ip 中的空白字符

... ... @@ -4,6 +4,7 @@
local realIp = ngx.req.get_headers()["X-YOHO-IP"]
if realIp and (string.find(ngx.var.http_host,"yohoops%.org") or string.find(ngx.var.http_host,"yohops%.com")) then
realIp=string.gsub(realIp,"%s","")
return realIp
end
... ... @@ -28,4 +29,8 @@ if realIp == nil then
realIp = ngx.var.remote_addr;
end
if realIp then
realIp=string.gsub(realIp,"%s","")
end
return realIp;
... ...