mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: don't onebox to IP addresses
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
require "ipaddr"
|
||||
|
||||
module Onebox
|
||||
module Engine
|
||||
class WhitelistedGenericOnebox
|
||||
|
||||
# overwrite the whitelist
|
||||
def self.===(other)
|
||||
true
|
||||
other.is_a?(URI) ? (IPAddr.new(other.hostname) rescue nil).nil? : true
|
||||
end
|
||||
|
||||
# ensure we're the last engine to be used
|
||||
|
||||
Reference in New Issue
Block a user