Skip to content

Commit

Permalink
Merge pull request #3652 from coursemology-collab/trang/carrierwave-s…
Browse files Browse the repository at this point in the history
…3-download

Pass decoded url to Carrierwave::Downloader
  • Loading branch information
trangmei committed Sep 13, 2019
2 parents 510e941 + 24dbf58 commit 7855619
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/uploaders/image_uploader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ def duplicate_from(other_uploader)
when 'CarrierWave::Storage::File'
cache!(File.new(other_uploader.file.path))
when 'CarrierWave::Storage::Fog', 'CarrierWave::Storage::AWS'
download!(other_uploader.url)
# Decode url to prevent double-encoding after carrierwave 2.0 upgrade
download!(CGI.unescape(other_uploader.url))
end
end

Expand Down

0 comments on commit 7855619

Please sign in to comment.