ruby-on-railsrubyamazon-s3shrine

How to define url X-AMZ-Expires in Shrine configuration


When we call the method url the value for X-AMZ-Expires can be defined with the argument expires_in.

Is there a way to define this on Shrine's configuration file or in the uploader so that every time I call url I wouldn't need to give the value of expired_in?


Solution

  • Yes, you can do it via the url_options plugin:

    Shrine.plugin :url_options, store: { expires_in: 60*60 }