mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +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:
@ -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
|
||||
|
Reference in New Issue
Block a user