Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: Properly encode the DAV path
This change is based on 85f6806

Signed-off-by: Robbert Gurdeep Singh <[email protected]>

Use encodeFilePath as it is availible

Signed-off-by: Robbert Gurdeep Singh <[email protected]>
  • Loading branch information
beardhatcode committed May 2, 2021
commit 43433b0e8e7c6a4a1aec151ddd562851f9a1f474
16 changes: 8 additions & 8 deletions js/viewer-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/viewer-main.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/mixins/PreviewUrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ export default {
// TODO: allow proper dav access without the need of basic auth
// https://github.com/nextcloud/server/issues/19700
if (isPublic()) {
return generateUrl(`/s/${getToken()}/download?path=${this.filename.replace(this.basename, '')}&files=${this.basename}`)
return generateUrl(`/s/${getToken()}/download?path=${encodeURIComponent(this.filename.replace(this.basename, ''))}&files=${encodeURIComponent(this.basename)}`)
}
return getRootPath() + this.filename
return getRootPath() + encodeFilePath(this.filename)
},
},
methods: {
Expand Down