telize

High performance JSON IP and GeoIP REST API (IP Geolocation)
Log | Files | Refs | README | LICENSE

commit 11c4b7cbe6d0c060446db0d9ab80a145fc15b00c
parent c08875a412cfd76776e084795822678d24d1dfd7
Author: Ludovic ROBINOT <lrobinot@gmail.com>
Date:   Fri,  9 Jan 2015 16:41:39 +0100

Fix region and isp name

http://www.telize.com/geoip/200.185.80.111 do not seems tu return an utf-8 string
Diffstat:
Mtelize | 10++++++++++
1 file changed, 10 insertions(+), 0 deletions(-)

diff --git a/telize b/telize @@ -120,6 +120,16 @@ server { args.city = cd:iconv(args.city) end + -- Convert region name to UTF-8 if it exists + if args.region ~= nil then + args.region = cd:iconv(args.region) + end + + -- Convert isp name to UTF-8 if it exists + if args.isp ~= nil then + args.isp = cd:iconv(args.isp) + end + if args.ip == "127.0.0.1" then ngx.status = ngx.HTTP_BAD_REQUEST ngx.say(cjson.encode({code = 401, message = "Input string is not a valid IP address"}))