Sha256: 8ddbe3ceb4efdeeaf0bfc5805eabe15354f434e32df869c3757578bf70d7a06e

Contents?: true

Size: 708 Bytes

Versions: 28

Compression:

Stored size: 708 Bytes

Contents

# frozen_string_literal: true

# 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::RepresentationsController < ActiveStorage::BaseController
  include ActiveStorage::SetBlob

  def show
    expires_in ActiveStorage::Blob.service.url_expires_in
    redirect_to @blob.representation(params[:variation_key]).processed.service_url(disposition: params[:disposition])
  end
end

Version data entries

28 entries across 28 versions & 2 rubygems

Version Path
activestorage-5.2.3.rc1 app/controllers/active_storage/representations_controller.rb
activestorage-5.2.2.1 app/controllers/active_storage/representations_controller.rb
activestorage-5.2.2 app/controllers/active_storage/representations_controller.rb
activestorage-5.2.2.rc1 app/controllers/active_storage/representations_controller.rb
activestorage-5.2.1.1 app/controllers/active_storage/representations_controller.rb
activestorage-5.2.1 app/controllers/active_storage/representations_controller.rb
activestorage-5.2.1.rc1 app/controllers/active_storage/representations_controller.rb
activestorage-5.2.0 app/controllers/active_storage/representations_controller.rb