mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 09:42:02 +08:00
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:
parent
1824ac9d39
commit
d1e3c213a7
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user