Permalink
Browse files

Merge pull request #11351 from jetthoughts/cleanup_request

Use content_length method instead of ENV['CONTENT_LENGTH'].to_i
  • Loading branch information...
2 parents 590c9d4 + c61b3ce commit ae85a4aa9875981d64db800377162f078e829f72 @rafaelfranca rafaelfranca committed Jul 9, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 actionpack/lib/action_dispatch/http/request.rb
View
2 actionpack/lib/action_dispatch/http/request.rb
@@ -226,7 +226,7 @@ def server_software
def raw_post
unless @env.include? 'RAW_POST_DATA'
raw_post_body = body
- @env['RAW_POST_DATA'] = raw_post_body.read(@env['CONTENT_LENGTH'].to_i)
+ @env['RAW_POST_DATA'] = raw_post_body.read(content_length)
raw_post_body.rewind if raw_post_body.respond_to?(:rewind)
end
@env['RAW_POST_DATA']

0 comments on commit ae85a4a

Please sign in to comment.