@capacitor/ios
Advanced tools
Comparing version 5.7.2 to 5.7.3
@@ -145,7 +145,10 @@ | ||
return url; | ||
let proxyUrl = new URL(url); | ||
const proxyUrl = new URL(url); | ||
const bridgeUrl = new URL((_b = (_a = win.Capacitor) === null || _a === void 0 ? void 0 : _a.getServerUrl()) !== null && _b !== void 0 ? _b : ''); | ||
const isHttps = proxyUrl.protocol === 'https:'; | ||
const originalHost = encodeURIComponent(proxyUrl.host); | ||
const originalPathname = proxyUrl.pathname; | ||
proxyUrl = new URL((_b = (_a = win.Capacitor) === null || _a === void 0 ? void 0 : _a.getServerUrl()) !== null && _b !== void 0 ? _b : ''); | ||
proxyUrl.protocol = bridgeUrl.protocol; | ||
proxyUrl.hostname = bridgeUrl.hostname; | ||
proxyUrl.port = bridgeUrl.port; | ||
proxyUrl.pathname = `${isHttps ? CAPACITOR_HTTPS_INTERCEPTOR : CAPACITOR_HTTP_INTERCEPTOR}/${originalHost}${originalPathname}`; | ||
@@ -505,5 +508,9 @@ return proxyUrl.toString(); | ||
options.method.toLocaleUpperCase() === 'TRACE') { | ||
const modifiedResource = createProxyUrl(resource.toString(), win); | ||
const response = await win.CapacitorWebFetch(modifiedResource, options); | ||
return response; | ||
if (typeof resource === 'string') { | ||
return await win.CapacitorWebFetch(createProxyUrl(resource, win), options); | ||
} | ||
else if (resource instanceof Request) { | ||
const modifiedRequest = new Request(createProxyUrl(resource.url, win), resource); | ||
return await win.CapacitorWebFetch(modifiedRequest, options); | ||
} | ||
} | ||
@@ -510,0 +517,0 @@ const tag = `CapacitorHttp fetch ${Date.now()} ${resource}`; |
{ | ||
"name": "@capacitor/ios", | ||
"version": "5.7.2", | ||
"version": "5.7.3", | ||
"description": "Capacitor: Cross-platform apps with JavaScript and the web", | ||
@@ -5,0 +5,0 @@ "homepage": "https://capacitorjs.com", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
348194
103
1029
271