diff --git a/android/capacitor/src/main/assets/native-bridge.js b/android/capacitor/src/main/assets/native-bridge.js index 5a3abdc2b9..e73f78f231 100644 --- a/android/capacitor/src/main/assets/native-bridge.js +++ b/android/capacitor/src/main/assets/native-bridge.js @@ -2,7 +2,7 @@ /*! Capacitor: https://capacitorjs.com/ - MIT License */ /* Generated File. Do not edit. */ -const nativeBridge = (function (exports) { +var nativeBridge = (function (exports) { 'use strict'; var ExceptionCode; @@ -376,7 +376,9 @@ const nativeBridge = (function (exports) { url: resource, method: (options === null || options === void 0 ? void 0 : options.method) ? options.method : undefined, data: (options === null || options === void 0 ? void 0 : options.body) ? options.body : undefined, - headers: (options === null || options === void 0 ? void 0 : options.headers) ? options.headers : undefined, + headers: (options === null || options === void 0 ? void 0 : options.headers) + ? JSON.stringify(options.headers) + : undefined, }); const data = typeof nativeResponse.data === 'string' ? nativeResponse.data @@ -500,7 +502,7 @@ const nativeBridge = (function (exports) { url: this._url, method: this._method, data: body !== null ? body : undefined, - headers: this._headers, + headers: JSON.stringify(this._headers), }) .then((nativeResponse) => { // intercept & parse response before returning diff --git a/core/native-bridge.ts b/core/native-bridge.ts index 31d6827d71..f356ba0fb7 100644 --- a/core/native-bridge.ts +++ b/core/native-bridge.ts @@ -427,7 +427,9 @@ const initBridge = (w: any): void => { url: resource, method: options?.method ? options.method : undefined, data: options?.body ? options.body : undefined, - headers: options?.headers ? options.headers : undefined, + headers: options?.headers + ? JSON.stringify(options.headers) + : undefined, }, ); @@ -583,7 +585,7 @@ const initBridge = (w: any): void => { url: this._url, method: this._method, data: body !== null ? body : undefined, - headers: this._headers, + headers: JSON.stringify(this._headers), }) .then((nativeResponse: any) => { // intercept & parse response before returning diff --git a/ios/Capacitor/Capacitor/assets/native-bridge.js b/ios/Capacitor/Capacitor/assets/native-bridge.js index 5a3abdc2b9..e73f78f231 100644 --- a/ios/Capacitor/Capacitor/assets/native-bridge.js +++ b/ios/Capacitor/Capacitor/assets/native-bridge.js @@ -2,7 +2,7 @@ /*! Capacitor: https://capacitorjs.com/ - MIT License */ /* Generated File. Do not edit. */ -const nativeBridge = (function (exports) { +var nativeBridge = (function (exports) { 'use strict'; var ExceptionCode; @@ -376,7 +376,9 @@ const nativeBridge = (function (exports) { url: resource, method: (options === null || options === void 0 ? void 0 : options.method) ? options.method : undefined, data: (options === null || options === void 0 ? void 0 : options.body) ? options.body : undefined, - headers: (options === null || options === void 0 ? void 0 : options.headers) ? options.headers : undefined, + headers: (options === null || options === void 0 ? void 0 : options.headers) + ? JSON.stringify(options.headers) + : undefined, }); const data = typeof nativeResponse.data === 'string' ? nativeResponse.data @@ -500,7 +502,7 @@ const nativeBridge = (function (exports) { url: this._url, method: this._method, data: body !== null ? body : undefined, - headers: this._headers, + headers: JSON.stringify(this._headers), }) .then((nativeResponse) => { // intercept & parse response before returning