Do not look up blank ips

No point attempting any kind of lookup on blank ip addresses
this simply adds log noise

Also ... freeze strings
This commit is contained in:
Sam 2018-11-19 15:50:21 +11:00
parent 1824ac9d39
commit d1e3c213a7

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'maxminddb'
require 'resolv'
@ -28,6 +30,7 @@ class DiscourseIpInfo
def lookup(ip, locale: :en, resolve_hostname: false)
ret = {}
return ret if ip.blank?
if @loc_mmdb
begin