aboutsummaryrefslogtreecommitdiffstats
path: root/app/javascript/activestorage/blob_record.js
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 /app/javascript/activestorage/blob_record.js
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 'app/javascript/activestorage/blob_record.js')
-rw-r--r--app/javascript/activestorage/blob_record.js6
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)