From dae69d46d8e1ee05fd8c3306bdada34d6b74fa5f Mon Sep 17 00:00:00 2001 From: Mark Anderson Date: Mon, 17 Jul 2023 11:57:37 -0400 Subject: [PATCH 1/2] fix: add http method to prototype.open --- android/capacitor/src/main/assets/native-bridge.js | 1 + core/native-bridge.ts | 1 + ios/Capacitor/Capacitor/assets/native-bridge.js | 1 + 3 files changed, 3 insertions(+) diff --git a/android/capacitor/src/main/assets/native-bridge.js b/android/capacitor/src/main/assets/native-bridge.js index 59b22caad..898d9d638 100644 --- a/android/capacitor/src/main/assets/native-bridge.js +++ b/android/capacitor/src/main/assets/native-bridge.js @@ -528,6 +528,7 @@ var nativeBridge = (function (exports) { // XHR patch open prototype.open = function (method, url) { this._url = url; + this._method = method; if (!(url.startsWith('http:') || url.toString().startsWith('https:'))) { return win.CapacitorWebXMLHttpRequest.open.call(this, method, url); } diff --git a/core/native-bridge.ts b/core/native-bridge.ts index c69103660..0056299a8 100644 --- a/core/native-bridge.ts +++ b/core/native-bridge.ts @@ -610,6 +610,7 @@ const initBridge = (w: any): void => { // XHR patch open prototype.open = function (method: string, url: string) { this._url = url; + this._method = method if ( !(url.startsWith('http:') || url.toString().startsWith('https:')) diff --git a/ios/Capacitor/Capacitor/assets/native-bridge.js b/ios/Capacitor/Capacitor/assets/native-bridge.js index 59b22caad..898d9d638 100644 --- a/ios/Capacitor/Capacitor/assets/native-bridge.js +++ b/ios/Capacitor/Capacitor/assets/native-bridge.js @@ -528,6 +528,7 @@ var nativeBridge = (function (exports) { // XHR patch open prototype.open = function (method, url) { this._url = url; + this._method = method; if (!(url.startsWith('http:') || url.toString().startsWith('https:'))) { return win.CapacitorWebXMLHttpRequest.open.call(this, method, url); } From 18bcd65dc5c6632679f4a92a5222f185745dc4f4 Mon Sep 17 00:00:00 2001 From: Mark Anderson Date: Mon, 17 Jul 2023 12:12:58 -0400 Subject: [PATCH 2/2] style: npm run fmt on core/native-bridge.ts --- core/native-bridge.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/native-bridge.ts b/core/native-bridge.ts index 0056299a8..021b4523a 100644 --- a/core/native-bridge.ts +++ b/core/native-bridge.ts @@ -610,7 +610,7 @@ const initBridge = (w: any): void => { // XHR patch open prototype.open = function (method: string, url: string) { this._url = url; - this._method = method + this._method = method; if ( !(url.startsWith('http:') || url.toString().startsWith('https:'))