summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2023-10-09 22:50:36 +0200
committerGitHub <noreply@github.com>2023-10-09 22:50:36 +0200
commit154b70292f1094e582a86484b5970e78569f4505 (patch)
tree96d6470c823672efe2b02748a15cb41667b53fd0 /apps
parentd5e53f03f489cae8a8475c4a346e3c3503d809ec (diff)
parentce0cc84c21c6ef8e4be207f9ed050dbaf52896c6 (diff)
downloadnextcloud-server-154b70292f1094e582a86484b5970e78569f4505.tar.gz
nextcloud-server-154b70292f1094e582a86484b5970e78569f4505.zip
Merge pull request #40757 from nextcloud/encode-uri-trashbin-delete-2
[stable27] fix: encode uri for trashbin delete
Diffstat (limited to 'apps')
-rw-r--r--apps/files_trashbin/src/actions/restoreAction.ts5
-rw-r--r--apps/files_trashbin/src/services/trashbin.ts2
2 files changed, 5 insertions, 2 deletions
diff --git a/apps/files_trashbin/src/actions/restoreAction.ts b/apps/files_trashbin/src/actions/restoreAction.ts
index d3e3f66a1df..f464602f01c 100644
--- a/apps/files_trashbin/src/actions/restoreAction.ts
+++ b/apps/files_trashbin/src/actions/restoreAction.ts
@@ -51,11 +51,14 @@ registerFileAction(new FileAction({
},
async exec(node: Node) {
+ const { origin } = new URL(node.source)
+ const encodedSource = origin + encodePath(node.source.slice(origin.length))
+
try {
const destination = generateRemoteUrl(encodePath(`dav/trashbin/${getCurrentUser()?.uid}/restore/${node.basename}`))
await axios({
method: 'MOVE',
- url: node.source,
+ url: encodedSource,
headers: {
destination,
},
diff --git a/apps/files_trashbin/src/services/trashbin.ts b/apps/files_trashbin/src/services/trashbin.ts
index 6027765dc4d..1c91e420557 100644
--- a/apps/files_trashbin/src/services/trashbin.ts
+++ b/apps/files_trashbin/src/services/trashbin.ts
@@ -58,7 +58,7 @@ const resultToNode = function(node: FileStat): File | Folder {
const nodeData = {
id: node.props?.fileid as number || 0,
- source: generateRemoteUrl(encodePath('dav' + rootPath + node.filename)),
+ source: generateRemoteUrl('dav' + rootPath + node.filename),
mtime: new Date(node.lastmod),
mime: node.mime as string,
size: node.props?.size as number || 0,