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.8.1 app/controllers/active_storage/representations_controller.rb
activestorage-5.2.8 app/controllers/active_storage/representations_controller.rb
activestorage-5.2.7.1 app/controllers/active_storage/representations_controller.rb
activestorage-5.2.7 app/controllers/active_storage/representations_controller.rb
activestorage-5.2.6.3 app/controllers/active_storage/representations_controller.rb
activestorage-5.2.6.2 app/controllers/active_storage/representations_controller.rb
activestorage-5.2.6.1 app/controllers/active_storage/representations_controller.rb
activestorage-5.2.6 app/controllers/active_storage/representations_controller.rb
activestorage-5.2.4.6 app/controllers/active_storage/representations_controller.rb
activestorage-5.2.5 app/controllers/active_storage/representations_controller.rb
activestorage-5.2.4.5 app/controllers/active_storage/representations_controller.rb
activestorage-5.2.4.4 app/controllers/active_storage/representations_controller.rb
activestorage-5.2.4.3 app/controllers/active_storage/representations_controller.rb
activestorage-5.2.4.2 app/controllers/active_storage/representations_controller.rb
activestorage-5.2.4.1 app/controllers/active_storage/representations_controller.rb
activestorage-5.2.4 app/controllers/active_storage/representations_controller.rb
activestorage-5.2.4.rc1 app/controllers/active_storage/representations_controller.rb
spiral_form-0.1.1 vendor/bundle/gems/activestorage-5.2.3/app/controllers/active_storage/representations_controller.rb
spiral_form-0.1.0 vendor/bundle/gems/activestorage-5.2.3/app/controllers/active_storage/representations_controller.rb
activestorage-5.2.3 app/controllers/active_storage/representations_controller.rb