Skip to content

Commit 6c9ff97

Browse files
WilhelmOksgithub-actions[bot]
authored andcommitted
fix: files percent encoding - WPB-23207 (#4244)
1 parent 892475a commit 6c9ff97

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

WireMessaging/Sources/WireMessagingDomain/WireDrive/UseCases/WireDriveRenameNodeUseCase.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,11 @@ package struct WireDriveRenameNodeUseCase: WireDriveRenameNodeUseCaseProtocol {
6868
targetPath = directory.appendingPathComponent("\(newFilename).\(pathExtension)")
6969
}
7070

71+
let path = targetPath.absoluteString.removingPercentEncoding ?? targetPath.absoluteString
72+
7173
// Checks whether the path doesn't already exist.
7274
let preCheckResult = try await nodesRepository.preCheck(
73-
nodePath: targetPath.absoluteString,
75+
nodePath: path,
7476
findAvailablePath: false
7577
)
7678

@@ -81,7 +83,7 @@ package struct WireDriveRenameNodeUseCase: WireDriveRenameNodeUseCaseProtocol {
8183
// Renames the file on the server.
8284
let didRenameFile = try await nodesRepository.renameNode(
8385
nodeID: nodeID,
84-
targetPath: targetPath.absoluteString
86+
targetPath: path
8587
)
8688

8789
guard didRenameFile else {

0 commit comments

Comments
 (0)