@capacitor/ios 5.7.4 → 5.7.5

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.
@@ -109,6 +109,12 @@ var nativeBridge = (function (exports) {
109
109
  headers: { 'Content-Type': contentType || 'application/octet-stream' },
110
110
  };
111
111
  }
112
+ else if (body instanceof URLSearchParams) {
113
+ return {
114
+ data: body.toString(),
115
+ type: 'text',
116
+ };
117
+ }
112
118
  else if (body instanceof FormData) {
113
119
  const formData = await convertFormData(body);
114
120
  const boundary = `${Date.now()}`;
@@ -379,15 +385,15 @@ var nativeBridge = (function (exports) {
379
385
  typeof c.dir === 'function');
380
386
  };
381
387
  const serializeConsoleMessage = (msg) => {
382
- if (typeof msg === 'object') {
383
- try {
388
+ try {
389
+ if (typeof msg === 'object') {
384
390
  msg = JSON.stringify(msg);
385
391
  }
386
- catch (e) {
387
- // ignore
388
- }
392
+ return String(msg);
393
+ }
394
+ catch (e) {
395
+ return '';
389
396
  }
390
- return String(msg);
391
397
  };
392
398
  const platform = getPlatformId(win);
393
399
  if (platform == 'android' || platform == 'ios') {
@@ -496,11 +502,11 @@ var nativeBridge = (function (exports) {
496
502
  if (request.url.startsWith(`${cap.getServerUrl()}/`)) {
497
503
  return win.CapacitorWebFetch(resource, options);
498
504
  }
499
- if (!(options === null || options === void 0 ? void 0 : options.method) ||
500
- options.method.toLocaleUpperCase() === 'GET' ||
501
- options.method.toLocaleUpperCase() === 'HEAD' ||
502
- options.method.toLocaleUpperCase() === 'OPTIONS' ||
503
- options.method.toLocaleUpperCase() === 'TRACE') {
505
+ const { method } = request;
506
+ if (method.toLocaleUpperCase() === 'GET' ||
507
+ method.toLocaleUpperCase() === 'HEAD' ||
508
+ method.toLocaleUpperCase() === 'OPTIONS' ||
509
+ method.toLocaleUpperCase() === 'TRACE') {
504
510
  if (typeof resource === 'string') {
505
511
  return await win.CapacitorWebFetch(createProxyUrl(resource, win), options);
506
512
  }
@@ -512,8 +518,7 @@ var nativeBridge = (function (exports) {
512
518
  const tag = `CapacitorHttp fetch ${Date.now()} ${resource}`;
513
519
  console.time(tag);
514
520
  try {
515
- // intercept request & pass to the bridge
516
- const { body, method } = request;
521
+ const { body } = request;
517
522
  const optionHeaders = Object.fromEntries(request.headers.entries());
518
523
  const { data: requestData, type, headers, } = await convertBody((options === null || options === void 0 ? void 0 : options.body) || body || undefined, optionHeaders['Content-Type'] || optionHeaders['content-type']);
519
524
  const nativeResponse = await cap.nativePromise('CapacitorHttp', 'request', {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capacitor/ios",
3
- "version": "5.7.4",
3
+ "version": "5.7.5",
4
4
  "description": "Capacitor: Cross-platform apps with JavaScript and the web",
5
5
  "homepage": "https://capacitorjs.com",
6
6
  "author": "Ionic Team <hi@ionic.io> (https://ionic.io)",