mirror of
https://github.com/nextcloud/server.git
synced 2026-06-10 17:23:59 -04:00
fix: encode uri for trashbin delete
Replace d280912f31 with a cleaner approach.
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
This commit is contained in:
parent
ffe533d3fc
commit
ce0cc84c21
4 changed files with 8 additions and 5 deletions
|
|
@ -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,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
4
dist/files_trashbin-main.js
vendored
4
dist/files_trashbin-main.js
vendored
File diff suppressed because one or more lines are too long
2
dist/files_trashbin-main.js.map
vendored
2
dist/files_trashbin-main.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue