telize

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

commit 2d62152ff5065706e37cf6d5f983b37d67127101
parent b7cef434b26841a9466a268f6bac2882f97fbcfc
Author: Frederic Cambus <fcambus@users.sourceforge.net>
Date:   Mon, 18 Aug 2014 23:30:29 +0200

Fixing a regression in /jsonip endpoint

Diffstat:
Mtelize | 7++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/telize b/telize @@ -79,7 +79,7 @@ server { country = ngx.var.arg_country, region = ngx.var.arg_region, region_code = ngx.var.arg_region_code, - city = cd:iconv(ngx.var.arg_city), + city = ngx.var.arg_city, postal_code = ngx.var.arg_postal_code, continent_code = ngx.var.arg_continent_code, latitude = ngx.var.arg_latitude, @@ -101,6 +101,11 @@ server { end end + -- Convert city name to UTF-8 if it exists + if args.city ~= nil then + args.city = cd:iconv(args.city) + 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"}))