aboutsummaryrefslogtreecommitdiffstats
path: root/lib/active_storage/service.rb
diff options
context:
space:
mode:
authorJavan Makhmali <javan@javan.us>2017-07-30 11:00:55 -0400
committerDavid Heinemeier Hansson <david@loudthinking.com>2017-07-30 10:00:55 -0500
commit39bfc836b8eb7482acf2784423414895b6d876c6 (patch)
treef8efc98262aaa47df4a5335bfe874be888301b85 /lib/active_storage/service.rb
parenta91bb13b8d5b7e3a75feed23e76121c516116d35 (diff)
downloadrails-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.rb7
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(