Sha256: 8f51e35fe4773e9e7134d49f01b015bc7ada45e15dd289afd1da3827e4dfb879
Contents?: true
Size: 947 Bytes
Versions: 35
Compression:
Stored size: 947 Bytes
Contents
# RootTenancyUrl will lookup configuration hash and # TODO: Write Tests (PN) module IuguSDK class RootTenancyUrl # +matches?+ will check a request.host against a set of invalid urls # # * *Args*: # - +request+ -> An ActionDispatch::Request object # * *Success* # - Return true if request.host is found in the invalid array # * *False* # - Return true if request.host is not found in the invalid array def self.matches?(request) application_domain = IuguSDK::application_main_host application_domain = application_domain.gsub('.dev','') valids = [ application_domain, ['www.',application_domain].join, 'localhost' ] normalized_host = request.host.gsub('.dev','') unless Rails.env.production? return true if normalized_host.match("#{application_domain}\.[^\.]+\.[^\.]+\.[^\.]+\.[^\.]+\.xip.io") end valids.include?( normalized_host ) end end end
Version data entries
35 entries across 35 versions & 1 rubygems