aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/metal
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2014-03-12 17:40:08 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2014-03-12 17:40:08 -0700
commit3df07d093a1e4207caa63fd2e3b67599211f5800 (patch)
tree253cf63f6757d8bfe0ba17dabdabc06305fe87a1 /actionpack/lib/action_controller/metal
parentc0a783610f5cf77050a55ad70b2cd2cf657bffe3 (diff)
downloadrails-3df07d093a1e4207caa63fd2e3b67599211f5800.tar.gz
rails-3df07d093a1e4207caa63fd2e3b67599211f5800.tar.bz2
rails-3df07d093a1e4207caa63fd2e3b67599211f5800.zip
use the body proxy to freeze headers
avoid freezing the headers until the web server has actually read data from the body proxy. Once the webserver has read data, then we should throw an error if someone tries to set a header
Diffstat (limited to 'actionpack/lib/action_controller/metal')
-rw-r--r--actionpack/lib/action_controller/metal/live.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/metal/live.rb b/actionpack/lib/action_controller/metal/live.rb
index fe63cf2b98..41b997a755 100644
--- a/actionpack/lib/action_controller/metal/live.rb
+++ b/actionpack/lib/action_controller/metal/live.rb
@@ -125,9 +125,11 @@ module ActionController
end
def each
+ @response.sending!
while str = @buf.pop
yield str
end
+ @response.sent!
end
def close
@@ -179,12 +181,16 @@ module ActionController
private
- def finalize_response
+ def before_committed
super
jar = request.cookie_jar
# The response can be committed multiple times
jar.write self unless committed?
- jar.commit!
+ end
+
+ def before_sending
+ super
+ request.cookie_jar.commit!
headers.freeze
end