telize

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

commit 73beaf6cb499aff159d7a4b24732c6ada2a96044
parent 55df0a62f67780894cf7b38183c2022651409cc5
Author: Frederic Cambus <fcambus@users.sourceforge.net>
Date:   Tue, 10 Nov 2015 16:38:43 +0100

Do not attempt to split GeoIP org field into ASN and ISP, return the raw organization string instead

Diffstat:
Mtelize | 17++---------------
1 file changed, 2 insertions(+), 15 deletions(-)

diff --git a/telize b/telize @@ -4,7 +4,7 @@ # http://www.telize.com # # # # Created: 2013/08/15 # -# Last Updated: 2015/10/27 # +# Last Updated: 2015/11/10 # # # # Telize is released under the BSD 3-Clause license. # # See LICENSE file for details. # @@ -95,13 +95,6 @@ server { ngx.exit(ngx.HTTP_OK) end - -- Splitting GeoIP organization string into ASN and ISP - if ngx.var.geoip_org then - index = string.find(ngx.var.geoip_org, "%s") - asn = string.sub(ngx.var.geoip_org, 0, index-1) - isp = string.sub(ngx.var.geoip_org, index+1) - end - local payload = { ip = ngx.var.remote_addr, country_code = ngx.var.geoip_city_country_code, @@ -116,10 +109,9 @@ server { longitude = ngx.var.geoip_longitude, dma_code = ngx.var.geoip_dma_code, area_code = ngx.var.geoip_area_code, + organization = ngx.var.geoip_org, timezone = ngx.var.geoip_timezone, offset = ngx.var.geoip_timezone_offset, - asn = asn, - isp = isp } local callback = ngx.var.arg_callback @@ -147,11 +139,6 @@ server { payload.region = cd:iconv(payload.region) end - -- Convert ISP name to UTF-8 if it exists - if payload.isp ~= nil then - payload.isp = cd:iconv(payload.isp) - end - local json = cjson.encode(payload) if callback ~= "" then