Sha256: c2564b8d57041fff2e3fbc2e619978ee0877df81b1089447ef465df3cc350fab
Contents?: true
Size: 833 Bytes
Versions: 15
Compression:
Stored size: 833 Bytes
Contents
module Simplec class Subdomains def self.matches?(request) simplec = request.headers['HTTP_X_ENGINE'] == 'simplec' present = request.subdomain.present? not_admin = request.subdomain != 'admin' subdomain = Simplec::Subdomain.find_by(name: request.subdomain) match = simplec || (present && not_admin && subdomain) if match Thread.current[:simplec_subdomain] = subdomain Rails.logger.info <<-LOG Simplec request received. ActionDispatch::Request#original_url: #{request.original_url} Simplec Engine: #{not_admin} LOG else Rails.logger.info <<-LOG Simplec Subdomain '#{request.subdomain}' was not found. ActionDispatch::Request#original_url: #{request.original_url} 'admin' subdomain bypass: #{!not_admin} LOG end match end end end
Version data entries
15 entries across 15 versions & 1 rubygems