diff options
author | Eric Wong <normalperson@yhbt.net> | 2013-11-06 03:02:48 +0000 |
---|---|---|
committer | James Tucker <jftucker@gmail.com> | 2014-07-14 21:09:17 -0700 |
commit | b51f3036fbdb911eac6b5cf97ebf9388fb1f14a9 (patch) | |
tree | c867be92f61f1d077a55f3541faff05f050ae8fd | |
parent | c25dede78d02bbcd9f836352be01ed24c28884a4 (diff) | |
download | rack-b51f3036fbdb911eac6b5cf97ebf9388fb1f14a9.tar.gz |
builder: avoid to_app on every request when using map
By calling to_app immediately after initializing the per-map Rack::Builder instances. Otherwise, benefits of warmup and web servers taking advantage of CoW are lost. This passes tests, and is lightly tested and I have not verified this for any negative consequences or incompatibilities. Signed-off-by: James Tucker <jftucker@gmail.com>
-rw-r--r-- | lib/rack/builder.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/rack/builder.rb b/lib/rack/builder.rb index a4f6c575..bda3be27 100644 --- a/lib/rack/builder.rb +++ b/lib/rack/builder.rb @@ -157,7 +157,7 @@ module Rack def generate_map(default_app, mapping) mapped = default_app ? {'/' => default_app} : {} - mapping.each { |r,b| mapped[r] = self.class.new(default_app, &b) } + mapping.each { |r,b| mapped[r] = self.class.new(default_app, &b).to_app } URLMap.new(mapped) end end |