Sha256: 3f508a2fe31599a394eb89a4854a3a3e7ebc9b6a610523cf759f63cc698ad4e9
Contents?: true
Size: 746 Bytes
Versions: 5
Compression:
Stored size: 746 Bytes
Contents
# frozen_string_literal: true # Take a signed permanent reference for a blob and turn it into an expiring service URL for download. # # WARNING: All Active Storage controllers are publicly accessible by default. The # generated URLs are hard to guess, but permanent by design. If your files # require a higher level of protection consider implementing # {Authenticated Controllers}[https://edgeguides.rubyonrails.org/active_storage_overview.html#authenticated-controllers]. class ActiveStorage::Blobs::RedirectController < ActiveStorage::BaseController include ActiveStorage::SetBlob def show expires_in ActiveStorage.service_urls_expire_in redirect_to @blob.url(disposition: params[:disposition]), allow_other_host: true end end
Version data entries
5 entries across 5 versions & 1 rubygems