Skip to content

Commit 6645372

Browse files
committed
Release v3.5.8: Fix path encoding for space and plus characters in object names, update fPutObject method signature to use named parameters for improved API consistency.
1 parent 3a59a0d commit 6645372

File tree

5 files changed

+18
-5
lines changed

5 files changed

+18
-5
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# 3.5.8
2+
3+
- Fix path encoding for space and plus characters in object names to prevent signature mismatch errors #7
4+
- Update fPutObject method signature to use named parameters for better API consistency
5+
16
# 3.5.7
27

38
- fix maxKeys error while using listObject query #97

lib/io.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ extension MinioX on Minio {
1111
Future<String> fPutObject(
1212
String bucket,
1313
String object,
14-
String filePath, [
14+
String filePath, {
1515
Map<String, String>? metadata,
16-
]) async {
16+
void Function(int)? onProgress,
17+
}) async {
1718
MinioInvalidBucketNameError.check(bucket);
1819
MinioInvalidObjectNameError.check(object);
1920

@@ -35,6 +36,7 @@ extension MinioX on Minio {
3536
file.openRead().cast<Uint8List>(),
3637
size: stat.size,
3738
metadata: metadata,
39+
onProgress: onProgress,
3840
);
3941
}
4042

lib/src/minio_helpers.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,12 @@ String encodePath(Uri uri) {
279279
continue;
280280
}
281281

282+
// Special handling for space and plus sign
283+
if (char == ' '.codeUnitAt(0) || char == '+'.codeUnitAt(0)) {
284+
result.write('%20');
285+
continue;
286+
}
287+
282288
result.write('%');
283289
result.write(hex.encode([char]).toUpperCase());
284290
}

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: minio
22
description: Unofficial MinIO Dart Client SDK that provides simple APIs to access any Amazon S3 compatible object storage server.
3-
version: 3.5.7
3+
version: 3.5.8
44
homepage: https://github.com/xtyxtyx/minio-dart
55
issue_tracker: https://github.com/xtyxtyx/minio-dart/issues
66

test/minio_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ void testFPutObject() {
220220
};
221221

222222
final minio = getMinioClient();
223-
await minio.fPutObject(bucketName, objectName, testFile.path, metadata);
223+
await minio.fPutObject(bucketName, objectName, testFile.path, metadata: metadata);
224224

225225
final stat = await minio.statObject(bucketName, objectName);
226226
expect(
@@ -237,7 +237,7 @@ void testFPutObject() {
237237
};
238238

239239
final minio = getMinioClient();
240-
await minio.fPutObject(bucketName, objectName, testFile.path, metadata);
240+
await minio.fPutObject(bucketName, objectName, testFile.path, metadata: metadata);
241241

242242
final stat = await minio.statObject(bucketName, objectName);
243243
expect(

0 commit comments

Comments
 (0)