Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ionic-team/capacitor
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 6.2.0
Choose a base ref
...
head repository: ionic-team/capacitor
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 6.2.1
Choose a head ref
  • 5 commits
  • 16 files changed
  • 3 contributors

Commits on Feb 6, 2025

  1. Copy the full SHA
    f34a008 View commit details

Commits on Feb 19, 2025

  1. fix(android): sanitize portable file name (#7894) (#7895)

    Co-authored-by: Dave Crombie <dcrombie29@googlemail.com>
    jcesarmobile and shipley-dcc authored Feb 19, 2025
    Copy the full SHA
    0ac1d50 View commit details

Commits on Mar 5, 2025

  1. Copy the full SHA
    03dcb5e View commit details
  2. Copy the full SHA
    459cac2 View commit details

Commits on Mar 31, 2025

  1. Release 6.2.1

    Github Workflow (on behalf of markemer) committed Mar 31, 2025
    Copy the full SHA
    347d10a View commit details
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -3,6 +3,15 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [6.2.1](https://github.com/ionic-team/capacitor/compare/6.2.0...6.2.1) (2025-03-31)

### Bug Fixes

- **android:** sanitize portable file name ([#7894](https://github.com/ionic-team/capacitor/issues/7894)) ([#7895](https://github.com/ionic-team/capacitor/issues/7895)) ([0ac1d50](https://github.com/ionic-team/capacitor/commit/0ac1d5039a8d8ab7d7070c76de988d36dbaafa5a))
- **cli:** don't run bundle if not installed ([#7896](https://github.com/ionic-team/capacitor/issues/7896)) ([#7903](https://github.com/ionic-team/capacitor/issues/7903)) ([03dcb5e](https://github.com/ionic-team/capacitor/commit/03dcb5ed358567bb9e33718c81a5128565163a4d))
- **http:** boundary not added for Request objects ([#7897](https://github.com/ionic-team/capacitor/issues/7897)) ([#7904](https://github.com/ionic-team/capacitor/issues/7904)) ([459cac2](https://github.com/ionic-team/capacitor/commit/459cac243a80f023653209aee3aca02a7db100ca))
- **ios:** don't check isMediaExtension on range requests ([#7868](https://github.com/ionic-team/capacitor/issues/7868)) ([#7873](https://github.com/ionic-team/capacitor/issues/7873)) ([f34a008](https://github.com/ionic-team/capacitor/commit/f34a0081ac0b5d80d55733a578cda6413fbf99fc))

# [6.2.0](https://github.com/ionic-team/capacitor/compare/6.1.2...6.2.0) (2024-11-19)

### Bug Fixes
7 changes: 7 additions & 0 deletions android/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -3,6 +3,13 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [6.2.1](https://github.com/ionic-team/capacitor/compare/6.2.0...6.2.1) (2025-03-31)

### Bug Fixes

- **android:** sanitize portable file name ([#7894](https://github.com/ionic-team/capacitor/issues/7894)) ([#7895](https://github.com/ionic-team/capacitor/issues/7895)) ([0ac1d50](https://github.com/ionic-team/capacitor/commit/0ac1d5039a8d8ab7d7070c76de988d36dbaafa5a))
- **http:** boundary not added for Request objects ([#7897](https://github.com/ionic-team/capacitor/issues/7897)) ([#7904](https://github.com/ionic-team/capacitor/issues/7904)) ([459cac2](https://github.com/ionic-team/capacitor/commit/459cac243a80f023653209aee3aca02a7db100ca))

# [6.2.0](https://github.com/ionic-team/capacitor/compare/6.1.2...6.2.0) (2024-11-19)

**Note:** Version bump only for package @capacitor/android
9 changes: 9 additions & 0 deletions android/capacitor/src/main/assets/native-bridge.js
Original file line number Diff line number Diff line change
@@ -497,6 +497,15 @@ var nativeBridge = (function (exports) {
if (doPatchHttp) {
// fetch patch
window.fetch = async (resource, options) => {
const headers = new Headers(options === null || options === void 0 ? void 0 : options.headers);
const contentType = headers.get('Content-Type') || headers.get('content-type');
if ((options === null || options === void 0 ? void 0 : options.body) instanceof FormData &&
(contentType === null || contentType === void 0 ? void 0 : contentType.includes('multipart/form-data')) &&
!contentType.includes('boundary')) {
headers.delete('Content-Type');
headers.delete('content-type');
options.headers = headers;
}
const request = new Request(resource, options);
if (request.url.startsWith(`${cap.getServerUrl()}/`)) {
return win.CapacitorWebFetch(resource, options);
13 changes: 12 additions & 1 deletion android/capacitor/src/main/java/com/getcapacitor/FileUtils.java
Original file line number Diff line number Diff line change
@@ -219,7 +219,8 @@ private static String getCopyFilePath(Uri uri, Context context) {
int nameIndex = cursor.getColumnIndex(OpenableColumns.DISPLAY_NAME);
cursor.moveToFirst();
String name = (cursor.getString(nameIndex));
File file = new File(context.getFilesDir(), name);
String fileName = sanitizeFilename(name);
File file = new File(context.getFilesDir(), fileName);
try {
InputStream inputStream = context.getContentResolver().openInputStream(uri);
FileOutputStream outputStream = new FileOutputStream(file);
@@ -289,4 +290,14 @@ private static String getPathToNonPrimaryVolume(Context context, String tag) {
}
return null;
}

private static String sanitizeFilename(String displayName) {
String[] badCharacters = new String[] { "..", "/" };
String[] segments = displayName.split("/");
String fileName = segments[segments.length - 1];
for (String suspString : badCharacters) {
fileName = fileName.replace(suspString, "_");
}
return fileName;
}
}
2 changes: 1 addition & 1 deletion android/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@capacitor/android",
"version": "6.2.0",
"version": "6.2.1",
"description": "Capacitor: Cross-platform apps with JavaScript and the web",
"homepage": "https://capacitorjs.com",
"author": "Ionic Team <hi@ionic.io> (https://ionic.io)",
6 changes: 6 additions & 0 deletions cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [6.2.1](https://github.com/ionic-team/capacitor/compare/6.2.0...6.2.1) (2025-03-31)

### Bug Fixes

- **cli:** don't run bundle if not installed ([#7896](https://github.com/ionic-team/capacitor/issues/7896)) ([#7903](https://github.com/ionic-team/capacitor/issues/7903)) ([03dcb5e](https://github.com/ionic-team/capacitor/commit/03dcb5ed358567bb9e33718c81a5128565163a4d))

# [6.2.0](https://github.com/ionic-team/capacitor/compare/6.1.2...6.2.0) (2024-11-19)

### Bug Fixes
2 changes: 1 addition & 1 deletion cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@capacitor/cli",
"version": "6.2.0",
"version": "6.2.1",
"description": "Capacitor: Cross-platform apps with JavaScript and the web",
"homepage": "https://capacitorjs.com",
"author": "Ionic Team <hi@ionic.io> (https://ionic.io)",
3 changes: 2 additions & 1 deletion cli/src/ios/update.ts
Original file line number Diff line number Diff line change
@@ -140,7 +140,8 @@ end`,
await writeFile(podfilePath, podfileContent, { encoding: 'utf-8' });

const podPath = await config.ios.podPath;
const useBundler = podPath.startsWith('bundle');
const useBundler =
podPath.startsWith('bundle') && (await isInstalled('bundle'));
const podCommandExists = await isInstalled('pod');
if (useBundler || podCommandExists) {
if (useBundler) {
6 changes: 6 additions & 0 deletions core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [6.2.1](https://github.com/ionic-team/capacitor/compare/6.2.0...6.2.1) (2025-03-31)

### Bug Fixes

- **http:** boundary not added for Request objects ([#7897](https://github.com/ionic-team/capacitor/issues/7897)) ([#7904](https://github.com/ionic-team/capacitor/issues/7904)) ([459cac2](https://github.com/ionic-team/capacitor/commit/459cac243a80f023653209aee3aca02a7db100ca))

# [6.2.0](https://github.com/ionic-team/capacitor/compare/6.1.2...6.2.0) (2024-11-19)

**Note:** Version bump only for package @capacitor/core
12 changes: 12 additions & 0 deletions core/native-bridge.ts
Original file line number Diff line number Diff line change
@@ -543,6 +543,18 @@ const initBridge = (w: any): void => {
resource: RequestInfo | URL,
options?: RequestInit,
) => {
const headers = new Headers(options?.headers);
const contentType =
headers.get('Content-Type') || headers.get('content-type');
if (
options?.body instanceof FormData &&
contentType?.includes('multipart/form-data') &&
!contentType.includes('boundary')
) {
headers.delete('Content-Type');
headers.delete('content-type');
options.headers = headers;
}
const request = new Request(resource, options);
if (request.url.startsWith(`${cap.getServerUrl()}/`)) {
return win.CapacitorWebFetch(resource, options);
2 changes: 1 addition & 1 deletion core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@capacitor/core",
"version": "6.2.0",
"version": "6.2.1",
"description": "Capacitor: Cross-platform apps with JavaScript and the web",
"homepage": "https://capacitorjs.com",
"author": "Ionic Team <hi@ionic.io> (https://ionic.io)",
7 changes: 7 additions & 0 deletions ios/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -3,6 +3,13 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [6.2.1](https://github.com/ionic-team/capacitor/compare/6.2.0...6.2.1) (2025-03-31)

### Bug Fixes

- **http:** boundary not added for Request objects ([#7897](https://github.com/ionic-team/capacitor/issues/7897)) ([#7904](https://github.com/ionic-team/capacitor/issues/7904)) ([459cac2](https://github.com/ionic-team/capacitor/commit/459cac243a80f023653209aee3aca02a7db100ca))
- **ios:** don't check isMediaExtension on range requests ([#7868](https://github.com/ionic-team/capacitor/issues/7868)) ([#7873](https://github.com/ionic-team/capacitor/issues/7873)) ([f34a008](https://github.com/ionic-team/capacitor/commit/f34a0081ac0b5d80d55733a578cda6413fbf99fc))

# [6.2.0](https://github.com/ionic-team/capacitor/compare/6.1.2...6.2.0) (2024-11-19)

### Bug Fixes
3 changes: 1 addition & 2 deletions ios/Capacitor/Capacitor/WebViewAssetHandler.swift
Original file line number Diff line number Diff line change
@@ -58,8 +58,7 @@ open class WebViewAssetHandler: NSObject, WKURLSchemeHandler {
}

if let rangeString = urlSchemeTask.request.value(forHTTPHeaderField: "Range"),
let totalSize = try fileUrl.resourceValues(forKeys: [.fileSizeKey]).fileSize,
isMediaExtension(pathExtension: url.pathExtension) {
let totalSize = try fileUrl.resourceValues(forKeys: [.fileSizeKey]).fileSize {
let fileHandle = try FileHandle(forReadingFrom: fileUrl)
let parts = rangeString.components(separatedBy: "=")
let streamParts = parts[1].components(separatedBy: "-")
9 changes: 9 additions & 0 deletions ios/Capacitor/Capacitor/assets/native-bridge.js
Original file line number Diff line number Diff line change
@@ -497,6 +497,15 @@ var nativeBridge = (function (exports) {
if (doPatchHttp) {
// fetch patch
window.fetch = async (resource, options) => {
const headers = new Headers(options === null || options === void 0 ? void 0 : options.headers);
const contentType = headers.get('Content-Type') || headers.get('content-type');
if ((options === null || options === void 0 ? void 0 : options.body) instanceof FormData &&
(contentType === null || contentType === void 0 ? void 0 : contentType.includes('multipart/form-data')) &&
!contentType.includes('boundary')) {
headers.delete('Content-Type');
headers.delete('content-type');
options.headers = headers;
}
const request = new Request(resource, options);
if (request.url.startsWith(`${cap.getServerUrl()}/`)) {
return win.CapacitorWebFetch(resource, options);
2 changes: 1 addition & 1 deletion ios/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@capacitor/ios",
"version": "6.2.0",
"version": "6.2.1",
"description": "Capacitor: Cross-platform apps with JavaScript and the web",
"homepage": "https://capacitorjs.com",
"author": "Ionic Team <hi@ionic.io> (https://ionic.io)",
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -11,6 +11,6 @@
"tagVersionPrefix": ""
}
},
"version": "6.2.0",
"version": "6.2.1",
"$schema": "node_modules/lerna/schemas/lerna-schema.json"
}