@@ -117,21 +117,24 @@ class Upload {
117
117
start ( ) {
118
118
const { file } = this ;
119
119
120
+ const metadata = {
121
+ 'availity-filename' : file . name ,
122
+ 'availity-content-type' : file . type ,
123
+ 'availity-attachment-name' : 'N/A' ,
124
+ } ;
125
+ if ( this . options . metadata ) {
126
+ Object . assign ( metadata , this . options . metadata ) ;
127
+ }
128
+
120
129
const upload = new tus . Upload ( file , {
121
130
resume : true ,
122
131
endpoint : `${ this . options . endpoint } /${ this . options . bucketId } /` ,
123
132
chunkSize : this . options . chunkSize ,
124
- metadata : {
125
- 'availity-filename' : file . name ,
126
- 'availity-content-type' : file . type ,
127
- 'availity-attachment-name' : 'N/A' ,
128
- } ,
133
+ metadata,
129
134
headers : {
130
135
'X-XSRF-TOKEN' : this . getToken ( ) ,
131
136
'X-Availity-Customer-ID' : this . options . customerId ,
132
137
'X-Client-ID' : this . options . clientId ,
133
- 'Availity-Filename' : file . name ,
134
- 'Availity-Content-Type' : file . type ,
135
138
} ,
136
139
onError : err => {
137
140
if ( ! this . isValidFile ( ) ) {
@@ -220,7 +223,7 @@ class Upload {
220
223
const uploadResult = xhr . getResponseHeader ( 'Upload-Result' ) ;
221
224
const msg = xhr . getResponseHeader ( 'Upload-Message' ) ;
222
225
if ( scanResult === 'rejected' ) {
223
- return { status : scanResult , message : msg || 'File scan failed ' } ;
226
+ return { status : scanResult , message : msg || 'Failed AV scan ' } ;
224
227
}
225
228
226
229
if ( uploadResult === 'rejected' ) {
0 commit comments