diff --git a/FileProvider.podspec b/FileProvider.podspec index ae013f0..eaea024 100644 --- a/FileProvider.podspec +++ b/FileProvider.podspec @@ -16,7 +16,7 @@ Pod::Spec.new do |s| # s.name = "FileProvider" - s.version = "0.10.0" + s.version = "0.10.1" s.summary = "FileManager replacement for Local and Remote (WebDAV/Dropbox/OneDrive/SMB2) files on iOS and macOS." # This description is used to generate tags and improve search results. diff --git a/FileProvider.xcodeproj/project.pbxproj b/FileProvider.xcodeproj/project.pbxproj index 5eda268..f6e6316 100644 --- a/FileProvider.xcodeproj/project.pbxproj +++ b/FileProvider.xcodeproj/project.pbxproj @@ -595,7 +595,7 @@ 799396601D48B7BF00086753 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - BUNDLE_VERSION_STRING = 0.10.0; + BUNDLE_VERSION_STRING = 0.10.1; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; @@ -625,7 +625,7 @@ 799396611D48B7BF00086753 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - BUNDLE_VERSION_STRING = 0.10.0; + BUNDLE_VERSION_STRING = 0.10.1; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; diff --git a/Sources/FileProvider.swift b/Sources/FileProvider.swift index 6929b56..d0ea539 100644 --- a/Sources/FileProvider.swift +++ b/Sources/FileProvider.swift @@ -205,13 +205,14 @@ extension FileProviderBasic { } else { rpath = self.currentPath } - if isPathRelative, let baseURL = baseURL { - if rpath.hasPrefix("/") { + rpath = rpath.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? rpath + if let baseURL = baseURL { + if isPathRelative && rpath.hasPrefix("/") { rpath.remove(at: rpath.startIndex) } - return URL(string: rpath.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed)!, relativeTo: baseURL)! + return URL(string: rpath, relativeTo: baseURL) ?? baseURL } else { - return URL(string: rpath.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed)!)!.standardizedFileURL + return URL(string: rpath)! } }