lib/rmobio/cas.rb in rmobio-1.1.29 vs lib/rmobio/cas.rb in rmobio-1.1.30

- old
+ new

@@ -135,9 +135,29 @@ # Here's where we override the filter def self.filter(controller) RAILS_DEFAULT_LOGGER.debug 'CAS: Starting filter...' unless not defined? RAILS_DEFAULT_LOGGER + # Figure out if we should execute the filter based on configuration + @req_domain = Rmobio::Utils.get_domain(controller.request.url) + @included_domains = MOBIO_CONFIG['cas_filter_included_domains'] + @run_filter = nil + + if @req_domain and @included_domains + @included_domains.each do |domain| + if domain.match(@req_domain) + RAILS_DEFAULT_LOGGER.debug "CAS: #{@req_domain} matches inclusion #{domain}, " + + "continuing with filter..." unless not defined? RAILS_DEFAULT_LOGGER + @run_filter = true + end + end + end + + # We didn't find a match + if @run_filter.nil? + return + end + @handset_id = controller.params[:handsetid] # handsetid gets appended to request uri, we need to remove it for # service validation to work controller.params.delete('handsetid') \ No newline at end of file