Skip to content

Commit 46a5e19

Browse files
fix: files percent encoding - WPB-23207 🍒 🍒 (#4256)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Wilhelm Oks <50032051+WilhelmOks@users.noreply.github.com>
1 parent 8f4067a commit 46a5e19

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)