0

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?

jpac
  • 69
  • 5

2 Answers2

8

Yes, you can do it via the url_options plugin:

Shrine.plugin :url_options, store: { expires_in: 60*60 }
Janko
  • 8,985
  • 7
  • 34
  • 51
-2

Adding to the above answer: This has changed recently to default_url_options:

Shrine.plugin :default_url_options, store: { expires_in: 60*60 }
Vivek S
  • 5,384
  • 8
  • 51
  • 72
  • 3
    In Shrine 3, the `default_url_options` plugin has been renamed to just `url_options`. – Janko Jan 29 '20 at 07:56