FIX: don't onebox to IP addresses

This commit is contained in:
Régis Hanol
2017-01-12 22:35:33 +01:00
parent 1570c4e4a7
commit 499a83270a
2 changed files with 21 additions and 1 deletions

View File

@@ -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