diff options
Diffstat (limited to 'activestorage/app/controllers/active_storage')
-rw-r--r-- | activestorage/app/controllers/active_storage/previews_controller.rb | 10 | ||||
-rw-r--r-- | activestorage/app/controllers/active_storage/representations_controller.rb (renamed from activestorage/app/controllers/active_storage/variants_controller.rb) | 6 |
2 files changed, 3 insertions, 13 deletions
diff --git a/activestorage/app/controllers/active_storage/previews_controller.rb b/activestorage/app/controllers/active_storage/previews_controller.rb deleted file mode 100644 index aa7ef58ca4..0000000000 --- a/activestorage/app/controllers/active_storage/previews_controller.rb +++ /dev/null @@ -1,10 +0,0 @@ -# frozen_string_literal: true - -class ActiveStorage::PreviewsController < ActionController::Base - include ActiveStorage::SetBlob - - def show - expires_in ActiveStorage::Blob.service.url_expires_in - redirect_to ActiveStorage::Preview.new(@blob, params[:variation_key]).processed.service_url(disposition: params[:disposition]) - end -end diff --git a/activestorage/app/controllers/active_storage/variants_controller.rb b/activestorage/app/controllers/active_storage/representations_controller.rb index e8f8dd592d..e0e944dc9c 100644 --- a/activestorage/app/controllers/active_storage/variants_controller.rb +++ b/activestorage/app/controllers/active_storage/representations_controller.rb @@ -1,14 +1,14 @@ # frozen_string_literal: true -# Take a signed permanent reference for a variant and turn it into an expiring service URL for download. +# Take a signed permanent reference for a blob representation and turn it into an expiring service URL for download. # Note: These URLs are publicly accessible. If you need to enforce access protection beyond the # security-through-obscurity factor of the signed blob and variation reference, you'll need to implement your own # authenticated redirection controller. -class ActiveStorage::VariantsController < ActionController::Base +class ActiveStorage::RepresentationsController < ActionController::Base include ActiveStorage::SetBlob def show expires_in ActiveStorage::Blob.service.url_expires_in - redirect_to ActiveStorage::Variant.new(@blob, params[:variation_key]).processed.service_url(disposition: params[:disposition]) + redirect_to @blob.representation(params[:variation_key]).processed.service_url(disposition: params[:disposition]) end end |