Sha256: c623b22ba300a2b4946fb4fc6a8452ba25d20a402b7131aa8a284d1f4175c51a

Contents?: true

Size: 556 Bytes

Versions: 9

Compression:

Stored size: 556 Bytes

Contents

# frozen_string_literal: true

# Proxy files through application. This avoids having a redirect and makes files easier to cache.
class ActiveStorage::Representations::ProxyController < ActiveStorage::BaseController
  include ActiveStorage::SetBlob
  include ActiveStorage::SetHeaders

  def show
    http_cache_forever public: true do
      set_content_headers_from representation.image
      stream representation
    end
  end

  private
    def representation
      @representation ||= @blob.representation(params[:variation_key]).processed
    end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
activestorage-6.1.3.2 app/controllers/active_storage/representations/proxy_controller.rb
activestorage-6.1.3.1 app/controllers/active_storage/representations/proxy_controller.rb
activestorage-6.1.3 app/controllers/active_storage/representations/proxy_controller.rb
activestorage-6.1.2.1 app/controllers/active_storage/representations/proxy_controller.rb
activestorage-6.1.2 app/controllers/active_storage/representations/proxy_controller.rb
activestorage-6.1.1 app/controllers/active_storage/representations/proxy_controller.rb
activestorage-6.1.0 app/controllers/active_storage/representations/proxy_controller.rb
activestorage-6.1.0.rc2 app/controllers/active_storage/representations/proxy_controller.rb
activestorage-6.1.0.rc1 app/controllers/active_storage/representations/proxy_controller.rb