Skip to content

Commit

Permalink
Add body_stream.rewind before reading it on ActionPack::Request
Browse files Browse the repository at this point in the history
  • Loading branch information
pedro108 committed Feb 10, 2023
1 parent 75126b8 commit c426e46
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions actionpack/lib/action_dispatch/http/request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,7 @@ def default_session
end

def read_body_stream
body_stream.rewind if body_stream.respond_to?(:rewind)
return body_stream.read if headers.key?("Transfer-Encoding") # Read body stream until EOF if "Transfer-Encoding" is present
body_stream.read(content_length)
end
Expand Down

0 comments on commit c426e46

Please sign in to comment.