summaryrefslogtreecommitdiffstats
path: root/src/components/MessagesList/MessagesGroup/Message/MessagePart/FilePreview.vue
diff options
context:
space:
mode:
authorVincent Petry <vincent@nextcloud.com>2021-05-27 16:55:48 +0200
committerVincent Petry <vincent@nextcloud.com>2021-05-27 17:24:16 +0200
commitacf697daeb6bc1776d48e1649f40fa66261e5fd8 (patch)
treec0db22b683697cdd243f4e51e0ad6537306b5123 /src/components/MessagesList/MessagesGroup/Message/MessagePart/FilePreview.vue
parent4b2ef5c08a0a976568178c52d174f6008c996eb2 (diff)
Encode dav path segments for direct preview
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Diffstat (limited to 'src/components/MessagesList/MessagesGroup/Message/MessagePart/FilePreview.vue')
-rw-r--r--src/components/MessagesList/MessagesGroup/Message/MessagePart/FilePreview.vue5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/components/MessagesList/MessagesGroup/Message/MessagePart/FilePreview.vue b/src/components/MessagesList/MessagesGroup/Message/MessagePart/FilePreview.vue
index c7d3b4292..b013d62d0 100644
--- a/src/components/MessagesList/MessagesGroup/Message/MessagePart/FilePreview.vue
+++ b/src/components/MessagesList/MessagesGroup/Message/MessagePart/FilePreview.vue
@@ -77,6 +77,7 @@ import Tooltip from '@nextcloud/vue/dist/Directives/Tooltip'
import Close from 'vue-material-design-icons/Close'
import PlayCircleOutline from 'vue-material-design-icons/PlayCircleOutline'
import { getCapabilities } from '@nextcloud/capabilities'
+import { encodePath } from '@nextcloud/paths'
const PREVIEW_TYPE = {
TEMPORARY: 0,
@@ -289,10 +290,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)
}
}