File tree Expand file tree Collapse file tree 3 files changed +9
-31
lines changed
android/capacitor/src/main/assets
ios/Capacitor/Capacitor/assets Expand file tree Collapse file tree 3 files changed +9
-31
lines changed Original file line number Diff line number Diff line change @@ -473,17 +473,9 @@ var nativeBridge = (function (exports) {
473473 if ( ( options === null || options === void 0 ? void 0 : options . body ) instanceof FormData &&
474474 ( contentType === null || contentType === void 0 ? void 0 : contentType . includes ( 'multipart/form-data' ) ) &&
475475 ! contentType . includes ( 'boundary' ) ) {
476- if ( options . headers instanceof Headers ) {
477- options . headers . delete ( 'Content-Type' ) ;
478- options . headers . delete ( 'content-type' ) ;
479- }
480- else if ( Array . isArray ( options . headers ) ) {
481- options . headers = options . headers . filter ( ( [ key ] ) => key !== 'Content-Type' && key !== 'content-type' ) ;
482- }
483- else if ( options . headers ) {
484- delete options . headers [ 'Content-Type' ] ;
485- delete options . headers [ 'content-type' ] ;
486- }
476+ headers . delete ( 'Content-Type' ) ;
477+ headers . delete ( 'content-type' ) ;
478+ options . headers = headers ;
487479 }
488480 const request = new Request ( resource , options ) ;
489481 if ( request . url . startsWith ( `${ cap . getServerUrl ( ) } /` ) ) {
Original file line number Diff line number Diff line change @@ -498,15 +498,9 @@ const initBridge = (w: any): void => {
498498 contentType ?. includes ( 'multipart/form-data' ) &&
499499 ! contentType . includes ( 'boundary' )
500500 ) {
501- if ( options . headers instanceof Headers ) {
502- options . headers . delete ( 'Content-Type' ) ;
503- options . headers . delete ( 'content-type' ) ;
504- } else if ( Array . isArray ( options . headers ) ) {
505- options . headers = options . headers . filter ( ( [ key ] ) => key !== 'Content-Type' && key !== 'content-type' ) ;
506- } else if ( options . headers ) {
507- delete options . headers [ 'Content-Type' ] ;
508- delete options . headers [ 'content-type' ] ;
509- }
501+ headers . delete ( 'Content-Type' ) ;
502+ headers . delete ( 'content-type' ) ;
503+ options . headers = headers ;
510504 }
511505 const request = new Request ( resource , options ) ;
512506 if ( request . url . startsWith ( `${ cap . getServerUrl ( ) } /` ) ) {
Original file line number Diff line number Diff line change @@ -473,17 +473,9 @@ var nativeBridge = (function (exports) {
473473 if ( ( options === null || options === void 0 ? void 0 : options . body ) instanceof FormData &&
474474 ( contentType === null || contentType === void 0 ? void 0 : contentType . includes ( 'multipart/form-data' ) ) &&
475475 ! contentType . includes ( 'boundary' ) ) {
476- if ( options . headers instanceof Headers ) {
477- options . headers . delete ( 'Content-Type' ) ;
478- options . headers . delete ( 'content-type' ) ;
479- }
480- else if ( Array . isArray ( options . headers ) ) {
481- options . headers = options . headers . filter ( ( [ key ] ) => key !== 'Content-Type' && key !== 'content-type' ) ;
482- }
483- else if ( options . headers ) {
484- delete options . headers [ 'Content-Type' ] ;
485- delete options . headers [ 'content-type' ] ;
486- }
476+ headers . delete ( 'Content-Type' ) ;
477+ headers . delete ( 'content-type' ) ;
478+ options . headers = headers ;
487479 }
488480 const request = new Request ( resource , options ) ;
489481 if ( request . url . startsWith ( `${ cap . getServerUrl ( ) } /` ) ) {
You can’t perform that action at this time.
0 commit comments