@capacitor/android 5.7.2 → 5.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -142,13 +142,13 @@ var nativeBridge = (function (exports) {
|
|
|
142
142
|
var _a, _b;
|
|
143
143
|
if (isRelativeOrProxyUrl(url))
|
|
144
144
|
return url;
|
|
145
|
-
|
|
145
|
+
const proxyUrl = new URL(url);
|
|
146
|
+
const bridgeUrl = new URL((_b = (_a = win.Capacitor) === null || _a === void 0 ? void 0 : _a.getServerUrl()) !== null && _b !== void 0 ? _b : '');
|
|
146
147
|
const isHttps = proxyUrl.protocol === 'https:';
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
return proxyUrl.toString();
|
|
148
|
+
bridgeUrl.search = proxyUrl.search;
|
|
149
|
+
bridgeUrl.hash = proxyUrl.hash;
|
|
150
|
+
bridgeUrl.pathname = `${isHttps ? CAPACITOR_HTTPS_INTERCEPTOR : CAPACITOR_HTTP_INTERCEPTOR}/${encodeURIComponent(proxyUrl.host)}${proxyUrl.pathname}`;
|
|
151
|
+
return bridgeUrl.toString();
|
|
152
152
|
};
|
|
153
153
|
const initBridge = (w) => {
|
|
154
154
|
const getPlatformId = (win) => {
|
|
@@ -501,9 +501,13 @@ var nativeBridge = (function (exports) {
|
|
|
501
501
|
options.method.toLocaleUpperCase() === 'HEAD' ||
|
|
502
502
|
options.method.toLocaleUpperCase() === 'OPTIONS' ||
|
|
503
503
|
options.method.toLocaleUpperCase() === 'TRACE') {
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
504
|
+
if (typeof resource === 'string') {
|
|
505
|
+
return await win.CapacitorWebFetch(createProxyUrl(resource, win), options);
|
|
506
|
+
}
|
|
507
|
+
else if (resource instanceof Request) {
|
|
508
|
+
const modifiedRequest = new Request(createProxyUrl(resource.url, win), resource);
|
|
509
|
+
return await win.CapacitorWebFetch(modifiedRequest, options);
|
|
510
|
+
}
|
|
507
511
|
}
|
|
508
512
|
const tag = `CapacitorHttp fetch ${Date.now()} ${resource}`;
|
|
509
513
|
console.time(tag);
|
package/package.json
CHANGED