Skip to content

Commit

Permalink
Remove dup from post body for forcing encoding (#39438)
Browse files Browse the repository at this point in the history
* Remove dup from post body for forcing encoding

* Properly assign raw_post variable to encoded version

Co-authored-by: Ryuta Kamizono <kamipo@gmail.com>
  • Loading branch information
vinistock and kamipo committed May 26, 2020
1 parent 8153954 commit 64b17ba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion actionpack/lib/action_dispatch/http/request.rb
Expand Up @@ -334,7 +334,7 @@ def raw_post
# variable is already set, wrap it in a StringIO.
def body
if raw_post = get_header("RAW_POST_DATA")
raw_post = raw_post.dup.force_encoding(Encoding::BINARY)
raw_post = (+raw_post).force_encoding(Encoding::BINARY)
StringIO.new(raw_post)
else
body_stream
Expand Down

0 comments on commit 64b17ba

Please sign in to comment.