1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #11351 from jetthoughts/cleanup_request

Use content_length method instead of ENV['CONTENT_LENGTH'].to_i
This commit is contained in:
Rafael Mendonça França 2013-07-09 01:47:43 -07:00
commit ae85a4aa98

View file

@ -226,7 +226,7 @@ module ActionDispatch
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']