telize

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

commit ef5506d2d672e6ca923272e41e8f1928f23763bf
parent a7dc9e6ca34b725ab82c7b450e452546fc53dd88
Author: Frederic Cambus <fcambus@users.sourceforge.net>
Date:   Mon, 26 Oct 2015 22:59:51 +0100

Fixing regression : do not attempt to tokenize the organization string if it's empty

Diffstat:
Mtelize | 9++++++---
1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/telize b/telize @@ -94,9 +94,12 @@ server { ngx.exit(ngx.HTTP_OK) end - 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) + -- 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.arg_ip,