diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2013-06-28 16:51:32 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-06-28 16:51:53 -0700 |
commit | 1b6aa27320f8ae4a34fcb5fbfb83a448449a76b5 (patch) | |
tree | 18fb946966323aa8f6c119fa26be82ff18678a60 /actionpack/lib | |
parent | 572f9b665a4004929d6e4ccb5137ccbefb49dd11 (diff) | |
download | rails-1b6aa27320f8ae4a34fcb5fbfb83a448449a76b5.tar.gz rails-1b6aa27320f8ae4a34fcb5fbfb83a448449a76b5.tar.bz2 rails-1b6aa27320f8ae4a34fcb5fbfb83a448449a76b5.zip |
writing the new body can cause the response to be committed and the
request thread to return up the stack before the instance variable is
assigned. Synchronize so that the ivar is assigned before the other
thread can activate.
fixes #10984
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_dispatch/http/response.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/http/response.rb b/actionpack/lib/action_dispatch/http/response.rb index 5697282791..d3696cbb8a 100644 --- a/actionpack/lib/action_dispatch/http/response.rb +++ b/actionpack/lib/action_dispatch/http/response.rb @@ -210,7 +210,9 @@ module ActionDispatch # :nodoc: if body.respond_to?(:to_path) @stream = body else - @stream = build_buffer self, munge_body_object(body) + synchronize do + @stream = build_buffer self, munge_body_object(body) + end end end |