@@ -215,17 +215,18 @@ export function request(options: HttpRequestOptions): Promise<HttpResponse> {
215215 formDataPartMediaType = value . type ;
216216 }
217217
218+ const filename = value . name || "" ;
218219 if ( value . data instanceof ArrayBuffer ) {
219220 const buffer = new Uint8Array ( value . data as ArrayBuffer ) ;
220- multipartFormData . addFileParameterNameFilenameContentType ( NSData . dataWithData ( buffer as any ) , key , value . name || "" , formDataPartMediaType ) ;
221+ multipartFormData . addFileParameterNameFilenameContentType ( NSData . dataWithData ( buffer as any ) , key , filename , formDataPartMediaType ) ;
221222 } else if ( value . data instanceof Blob ) {
222223 // Stolen from core xhr, not sure if we should use InternalAccessor, but it provides fast access.
223224 // @ts -ignore
224225 const buffer = new Uint8Array ( Blob . InternalAccessor . getBuffer ( value . data ) . buffer . slice ( 0 ) as ArrayBuffer ) ;
225- multipartFormData . addFileParameterNameFilenameContentType ( NSData . dataWithData ( buffer as any ) , key , value . name || "" , formDataPartMediaType ) ;
226+ multipartFormData . addFileParameterNameFilenameContentType ( NSData . dataWithData ( buffer as any ) , key , filename , formDataPartMediaType ) ;
226227 } else {
227228 // Support for native file objects.
228- multipartFormData . addFileParameterNameFilenameContentType ( value . data , key , value . name , formDataPartMediaType ) ;
229+ multipartFormData . addFileParameterNameFilenameContentType ( value . data , key , filename , formDataPartMediaType ) ;
229230 }
230231 } else {
231232 // Support for native file objects.
0 commit comments