app/javascript/activestorage/direct_upload.js in activestorage-7.0.8.6 vs app/javascript/activestorage/direct_upload.js in activestorage-7.1.0.beta1

- old
+ new

@@ -3,24 +3,25 @@ import { BlobUpload } from "./blob_upload" let id = 0 export class DirectUpload { - constructor(file, url, delegate) { + constructor(file, url, delegate, customHeaders = {}) { this.id = ++id this.file = file this.url = url this.delegate = delegate + this.customHeaders = customHeaders } create(callback) { FileChecksum.create(this.file, (error, checksum) => { if (error) { callback(error) return } - const blob = new BlobRecord(this.file, checksum, this.url) + const blob = new BlobRecord(this.file, checksum, this.url, this.customHeaders) notify(this.delegate, "directUploadWillCreateBlobWithXHR", blob.xhr) blob.create(error => { if (error) { callback(error)