diff options
author | Javan Makhmali <javan@javan.us> | 2017-07-30 11:00:55 -0400 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2017-07-30 10:00:55 -0500 |
commit | 39bfc836b8eb7482acf2784423414895b6d876c6 (patch) | |
tree | f8efc98262aaa47df4a5335bfe874be888301b85 /lib/active_storage/service.rb | |
parent | a91bb13b8d5b7e3a75feed23e76121c516116d35 (diff) | |
download | rails-39bfc836b8eb7482acf2784423414895b6d876c6.tar.gz rails-39bfc836b8eb7482acf2784423414895b6d876c6.tar.bz2 rails-39bfc836b8eb7482acf2784423414895b6d876c6.zip |
Configure per-service request headers for direct uploads (#83)
* Configure per-service request headers for direct uploads
* Fix header hashes
Diffstat (limited to 'lib/active_storage/service.rb')
-rw-r--r-- | lib/active_storage/service.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/active_storage/service.rb b/lib/active_storage/service.rb index e6361318a8..b648c51823 100644 --- a/lib/active_storage/service.rb +++ b/lib/active_storage/service.rb @@ -87,13 +87,18 @@ class ActiveStorage::Service end # Returns a signed, temporary URL that a direct upload file can be PUT to on the `key`. - # The URL will be valid for the amount of seconds specified in `expires_in`. + # The URL will be valid for the amount of seconds specified in `expires_in`. # You most also provide the `content_type`, `content_length`, and `checksum` of the file # that will be uploaded. All these attributes will be validated by the service upon upload. def url_for_direct_upload(key, expires_in:, content_type:, content_length:, checksum:) raise NotImplementedError end + # Returns a Hash of headers for `url_for_direct_upload` requests. + def headers_for_direct_upload(key, filename:, content_type:, content_length:, checksum:) + {} + end + private def instrument(operation, key, payload = {}, &block) ActiveSupport::Notifications.instrument( |