Skip to content
Browse files

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
  • Loading branch information...
1 parent b407839 commit de20a6d15ac98464b87e8be9a493050b741e2fd2 @tenderlove tenderlove committed Jun 28, 2013
Showing with 3 additions and 1 deletion.
  1. +3 −1 actionpack/lib/action_dispatch/http/response.rb
View
4 actionpack/lib/action_dispatch/http/response.rb
@@ -198,7 +198,9 @@ def body=(body)
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

0 comments on commit de20a6d

Please sign in to comment.
Something went wrong with that request. Please try again.