Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add options to allow extending expiring URL generation #3

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/paperclip/storage/s3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,9 @@ def self.extended base
end unless Paperclip::Interpolations.respond_to? :asset_host
end

def expiring_url(time = 3600, style_name = default_style)
def expiring_url(time = 3600, style_name = default_style, extra_options = {})
if path(style_name)
base_options = { expires_in: time }
base_options = { expires_in: time }.merge(extra_options)
s3_object(style_name).presigned_url(
:get,
base_options.merge(s3_url_options),
Expand Down