diff options
author | Kir Shatrov <shatrov@me.com> | 2017-07-24 23:38:04 +0300 |
---|---|---|
committer | Kir Shatrov <shatrov@me.com> | 2017-07-24 23:38:04 +0300 |
commit | c0e2cfdc3fd476e229ede5cda59dea6374a730e7 (patch) | |
tree | 1fdc8c1ab391187d4d2a7ec45d132a29f9d42097 /actionpack/lib | |
parent | 9c35bf2a6a27431c6aa283db781c19f61c5155be (diff) | |
download | rails-c0e2cfdc3fd476e229ede5cda59dea6374a730e7.tar.gz rails-c0e2cfdc3fd476e229ede5cda59dea6374a730e7.tar.bz2 rails-c0e2cfdc3fd476e229ede5cda59dea6374a730e7.zip |
Make actionpack frozen string friendly
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_controller/metal/http_authentication.rb | 4 | ||||
-rw-r--r-- | actionpack/lib/action_dispatch/http/request.rb | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/metal/http_authentication.rb b/actionpack/lib/action_controller/metal/http_authentication.rb index d8bc895265..08d9b094f3 100644 --- a/actionpack/lib/action_controller/metal/http_authentication.rb +++ b/actionpack/lib/action_controller/metal/http_authentication.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "base64" require "active_support/security_utils" @@ -475,7 +477,7 @@ module ActionController # This removes the <tt>"</tt> characters wrapping the value. def rewrite_param_values(array_params) - array_params.each { |param| (param[1] || "").gsub! %r/^"|"$/, "" } + array_params.each { |param| (param[1] || "".dup).gsub! %r/^"|"$/, "" } end # This method takes an authorization body and splits up the key-value diff --git a/actionpack/lib/action_dispatch/http/request.rb b/actionpack/lib/action_dispatch/http/request.rb index fd986d88e7..94b0d4880c 100644 --- a/actionpack/lib/action_dispatch/http/request.rb +++ b/actionpack/lib/action_dispatch/http/request.rb @@ -300,7 +300,7 @@ module ActionDispatch # variable is already set, wrap it in a StringIO. def body if raw_post = get_header("RAW_POST_DATA") - raw_post.force_encoding(Encoding::BINARY) + raw_post = raw_post.dup.force_encoding(Encoding::BINARY) StringIO.new(raw_post) else body_stream |