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:
commit
ae85a4aa98
1 changed files with 1 additions and 1 deletions
|
@ -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']
|
||||
|
|
Loading…
Reference in a new issue