aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/rack/cascade.rb
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2008-12-19 11:04:27 -0600
committerJoshua Peek <josh@joshpeek.com>2008-12-19 11:07:25 -0600
commit12e416a04b764d0b212e04a53b770f60dc0d7071 (patch)
tree7f1ef6c1357ea1353dc4e919557b0779983dfda1 /railties/lib/rails/rack/cascade.rb
parentc3f53f412cd170fc295b46e48aa81837ad15ec83 (diff)
downloadrails-12e416a04b764d0b212e04a53b770f60dc0d7071.tar.gz
rails-12e416a04b764d0b212e04a53b770f60dc0d7071.tar.bz2
rails-12e416a04b764d0b212e04a53b770f60dc0d7071.zip
Diverge Metal implementation from Rack::Cascade since we want the last app to return its headers and body if the status is a 404.
Diffstat (limited to 'railties/lib/rails/rack/cascade.rb')
-rw-r--r--railties/lib/rails/rack/cascade.rb31
1 files changed, 0 insertions, 31 deletions
diff --git a/railties/lib/rails/rack/cascade.rb b/railties/lib/rails/rack/cascade.rb
deleted file mode 100644
index d5af7fc77e..0000000000
--- a/railties/lib/rails/rack/cascade.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-require 'active_support/ordered_hash'
-
-module Rails
- module Rack
- # Try a request on several apps; return the first non-404 response.
- class Cascade
- attr_reader :apps
-
- def initialize(apps)
- @apps = ActiveSupport::OrderedHash.new
- apps.each { |app| add app }
- end
-
- def call(env)
- @apps.keys.each do |app|
- result = app.call(env)
- return result unless result[0].to_i == 404
- end
- Metal::NotFoundResponse
- end
-
- def add(app)
- @apps[app] = true
- end
-
- def include?(app)
- @apps.include?(app)
- end
- end
- end
-end