# File lib/rack/cors.rb, line 238 def self.hit(env) r = Result.new r.preflight = false r.hit = true env[RACK_CORS] = r end
# File lib/rack/cors.rb, line 245 def self.miss(env, reason) r = Result.new r.preflight = false r.hit = false r.miss_reason = reason env[RACK_CORS] = r end
# File lib/rack/cors.rb, line 253 def self.preflight(env) r = Result.new r.preflight = true env[RACK_CORS] = r end
# File lib/rack/cors.rb, line 260 def append_header(headers) headers[HEADER_KEY] = if hit? preflight? ? 'preflight-hit' : 'hit' else [ (preflight? ? 'preflight-miss' : 'miss'), miss_reason ].join('; ') end end
# File lib/rack/cors.rb, line 225 def hit? !!hit end
# File lib/rack/cors.rb, line 233 def miss(reason) self.hit = false self.miss_reason = reason end
# File lib/rack/cors.rb, line 229 def preflight? !!preflight end