Sha256: fb45ef2d072d7966e1bccff24c5bf0e570c41c36849266f7b67527c52fdb3711
Contents?: true
Size: 566 Bytes
Versions: 13
Compression:
Stored size: 566 Bytes
Contents
module PactBroker module Webhooks class CheckHostWhitelist def self.call(host, whitelist = PactBroker.configuration.webhook_host_whitelist) whitelist.select{ | whitelist_host | match?(host, whitelist_host) } end def self.match?(host, whitelist_host) if whitelist_host.is_a?(Regexp) host =~ whitelist_host else begin IPAddr.new(whitelist_host) === IPAddr.new(host) rescue IPAddr::Error host == whitelist_host end end end end end end
Version data entries
13 entries across 13 versions & 1 rubygems