Sha256: 1f736c63a910c96709bd84a46156ea1d422407a1591d05c822425db9e85047e0
Contents?: true
Size: 572 Bytes
Versions: 5
Compression:
Stored size: 572 Bytes
Contents
class SiteDetector def initialize(app) @app = app end def call(env) request = Rack::Request.new(env) site = Site.where(domains: request.host).first env['yodel.site'] = site unless site.nil? if Yodel.env.production? raise MissingRootDirectory.new(site, request.port) if !File.directory?(site.root_directory) env['rack.session.options'][:domain] = ".#{site.domains.first}" end else raise DomainNotFound.new(request.host, request.port) if Yodel.env.production? end @app.call(env) end end
Version data entries
5 entries across 5 versions & 1 rubygems