Skip to content

Commit

Permalink
fix: encode basename in restore action
Browse files Browse the repository at this point in the history
As per https://xhr.spec.whatwg.org/#the-setrequestheader()-method and https://infra.spec.whatwg.org/#byte-sequences the header value must be in the range 0x20 (SP) to 0x7E (~) hence we need to encode everything else.

Signed-off-by: Daniel Kesselberg <[email protected]>
  • Loading branch information
kesselb committed Aug 12, 2023
1 parent 50d1f53 commit 90731c2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion apps/files_trashbin/src/actions/restoreAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ registerFileAction(new FileAction({

async exec(node: Node) {
try {
const destination = generateRemoteUrl(`dav/trashbin/${getCurrentUser()?.uid}/restore/${node.basename}`)
const destination = generateRemoteUrl(`dav/trashbin/${getCurrentUser()?.uid}/restore/${encodeURIComponent(node.basename)}`)
await axios({
method: 'MOVE',
url: node.source,
Expand Down
Loading

0 comments on commit 90731c2

Please sign in to comment.