diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-12-11 15:58:11 -0800 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-12-11 21:01:49 -0300 |
commit | 6fbee4fc539cc29c68c0d515fa5e0af208f3f681 (patch) | |
tree | 915c49eeb89561badd598c8993fb2c9247907afa /actionpack/lib | |
parent | 73f0d537c9f50a754e71fdc74dad1fb28824b4fb (diff) | |
download | rails-6fbee4fc539cc29c68c0d515fa5e0af208f3f681.tar.gz rails-6fbee4fc539cc29c68c0d515fa5e0af208f3f681.tar.bz2 rails-6fbee4fc539cc29c68c0d515fa5e0af208f3f681.zip |
Merge pull request #8490 from mattv/fix_request_raw_post
Fix rewinding in ActionDispatch::Request#raw_post
Conflicts:
actionpack/CHANGELOG.md
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_dispatch/http/request.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/http/request.rb b/actionpack/lib/action_dispatch/http/request.rb index afc0496ef9..0413346d94 100644 --- a/actionpack/lib/action_dispatch/http/request.rb +++ b/actionpack/lib/action_dispatch/http/request.rb @@ -179,8 +179,9 @@ module ActionDispatch # work with raw requests directly. def raw_post unless @env.include? 'RAW_POST_DATA' - @env['RAW_POST_DATA'] = body.read(@env['CONTENT_LENGTH'].to_i) - body.rewind if body.respond_to?(:rewind) + raw_post_body = body + @env['RAW_POST_DATA'] = raw_post_body.read(@env['CONTENT_LENGTH'].to_i) + raw_post_body.rewind if raw_post_body.respond_to?(:rewind) end @env['RAW_POST_DATA'] end |