diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2017-05-17 15:04:45 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-17 15:04:45 -0400 |
commit | 385d9af299fbfac7f063de214d371545bafef5df (patch) | |
tree | 56b9271980dd466f39f58bc67956697d59f54805 /actionpack/lib | |
parent | e4bfa22cee25c43d88d895926cdeed79c54a761f (diff) | |
parent | bfbbb1207930e7ebe56d4a99abd53b2aa66e0b6e (diff) | |
download | rails-385d9af299fbfac7f063de214d371545bafef5df.tar.gz rails-385d9af299fbfac7f063de214d371545bafef5df.tar.bz2 rails-385d9af299fbfac7f063de214d371545bafef5df.zip |
Merge pull request #29063 from sepehr500/master
Fixed Frozen string error in actionpack
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_dispatch/http/upload.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/http/upload.rb b/actionpack/lib/action_dispatch/http/upload.rb index 61ba052e45..225272d66e 100644 --- a/actionpack/lib/action_dispatch/http/upload.rb +++ b/actionpack/lib/action_dispatch/http/upload.rb @@ -27,14 +27,18 @@ module ActionDispatch @tempfile = hash[:tempfile] raise(ArgumentError, ":tempfile is required") unless @tempfile - @original_filename = hash[:filename] - if @original_filename + if hash[:filename] + @original_filename = hash[:filename].dup + begin @original_filename.encode!(Encoding::UTF_8) rescue EncodingError @original_filename.force_encoding(Encoding::UTF_8) end + else + @original_filename = nil end + @content_type = hash[:type] @headers = hash[:head] end |