mirror of
https://github.com/mastodon/mastodon.git
synced 2025-09-05 09:21:11 +00:00
Merge 5c41bb0747
into 14cb5ff881
This commit is contained in:
commit
439efac880
|
@ -23,7 +23,8 @@ module RoutingHelper
|
|||
def expiring_asset_url(attachment, expires_in)
|
||||
case Paperclip::Attachment.default_options[:storage]
|
||||
when :s3, :azure
|
||||
attachment.expiring_url(expires_in.to_i)
|
||||
url = attachment.expiring_url(expires_in.to_i)
|
||||
ENV.key?('S3_ALIAS_HOST') ? url.sub("#{ENV.fetch('S3_ENDPOINT')}/#{ENV.fetch('S3_BUCKET')}", "https://#{ENV.fetch('S3_ALIAS_HOST')}") : url
|
||||
when :fog
|
||||
if Paperclip::Attachment.default_options.dig(:fog_credentials, :openstack_temp_url_key).present?
|
||||
attachment.expiring_url(expires_in.from_now)
|
||||
|
|
Loading…
Reference in New Issue
Block a user