Sha256: c12d8776f7afe4267d0dcbe6e815bea4722a6abdaa687a985a3fcef6e6c15039

Contents?: true

Size: 701 Bytes

Versions: 1

Compression:

Stored size: 701 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 < ActionController::Base
  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

1 entries across 1 versions & 1 rubygems

Version Path
activestorage-5.2.0.rc2 app/controllers/active_storage/representations_controller.rb