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 /app/javascript/activestorage/blob_record.js | |
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 'app/javascript/activestorage/blob_record.js')
-rw-r--r-- | app/javascript/activestorage/blob_record.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/javascript/activestorage/blob_record.js b/app/javascript/activestorage/blob_record.js index 9b7801afd5..3c6e6b6ba1 100644 --- a/app/javascript/activestorage/blob_record.js +++ b/app/javascript/activestorage/blob_record.js @@ -30,8 +30,10 @@ export class BlobRecord { requestDidLoad(event) { const { status, response } = this.xhr if (status >= 200 && status < 300) { - this.attributes.signed_id = response.signed_blob_id - this.uploadURL = response.upload_to_url + const { direct_upload } = response + delete response.direct_upload + this.attributes = response + this.directUploadData = direct_upload this.callback(null, this.toJSON()) } else { this.requestDidError(event) |