From 79842d917191fb81c0e7eae809aeea7c7b9c08e6 Mon Sep 17 00:00:00 2001 From: MaysWind Date: Tue, 2 Dec 2025 23:27:24 +0800 Subject: [PATCH] fix cannot access Alibaba Cloud OSS using minio object storage type (#230) --- pkg/storage/minio_storage.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/storage/minio_storage.go b/pkg/storage/minio_storage.go index 073874a3..5fa36cc8 100644 --- a/pkg/storage/minio_storage.go +++ b/pkg/storage/minio_storage.go @@ -95,10 +95,14 @@ func (s *MinIOObjectStorage) Delete(ctx core.Context, path string) error { func (s *MinIOObjectStorage) getFinalPath(path string) string { rootPath := s.rootPath - if len(rootPath) < 1 || rootPath[len(rootPath)-1] != '/' { + if len(rootPath) > 0 && rootPath[len(rootPath)-1] != '/' { rootPath = rootPath + "/" } + if len(rootPath) > 0 && rootPath[0] == '/' { + rootPath = rootPath[1:] + } + if len(path) > 0 && path[0] == '/' { path = path[1:] }