Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
Encode dav path segments for direct preview
Signed-off-by: Vincent Petry <[email protected]>
  • Loading branch information
PVince81 committed May 27, 2021
commit f1fb07650a29b56820f46968d26eb2dd8592a555
30 changes: 22 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"@nextcloud/initial-state": "^1.2.0",
"@nextcloud/l10n": "^1.4.1",
"@nextcloud/moment": "^1.1.1",
"@nextcloud/paths": "^2.0.0",
"@nextcloud/router": "^1.2.0",
"@nextcloud/vue": "^3.5.4",
"@nextcloud/vue-dashboard": "^1.0.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ import ProgressBar from '@nextcloud/vue/dist/Components/ProgressBar'
import Tooltip from '@nextcloud/vue/dist/Directives/Tooltip'
import Close from 'vue-material-design-icons/Close'
import { getCapabilities } from '@nextcloud/capabilities'
import { encodePath } from '@nextcloud/paths'

const PREVIEW_TYPE = {
TEMPORARY: 0,
Expand Down Expand Up @@ -248,10 +249,10 @@ export default {
// return direct image
if (userId === null) {
// guest mode, use public link download URL
return this.link + '/download/' + this.name
return this.link + '/download/' + encodePath(this.name)
} else {
// use direct DAV URL
return generateRemoteUrl(`dav/files/${userId}`) + this.internalAbsolutePath
return generateRemoteUrl(`dav/files/${userId}`) + encodePath(this.internalAbsolutePath)
}
}

Expand Down