Skip to content

Commit e3d1519

Browse files
committed
fix: urlencode file source based on resource url
Signed-off-by: Kent Delante <kent@delante.me> Assisted-by: ClaudCode:claude-sonnet-5
1 parent f127e1a commit e3d1519

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/views/Viewer.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,14 +1157,18 @@ export default defineComponent({
11571157
try {
11581158
const fileid = this.currentFile.fileid
11591159
const url = this.currentFile.source ?? this.currentFile.davPath
1160+
const isDavResource = url.includes('remote.php/dav')
11601161
11611162
// Fake node to emit the event until Viewer is migrated to the new Node API.
1163+
// The node source must stay un-encoded (like the nodes built elsewhere in
1164+
// this file) as consumers of the event compare it against the store, which
1165+
// keeps sources decoded. The request below still uses the encoded `url`.
11621166
const node = new NcFile({
1163-
source: url,
1167+
source: isDavResource ? (defaultRemoteURL + getRootPath() + this.currentFile.filename) : url,
11641168
id: fileid,
11651169
mime: this.currentFile.mime,
11661170
owner: this.currentFile.ownerId,
1167-
root: url.includes('remote.php/dav') ? davGetRootPath() : undefined,
1171+
root: isDavResource ? davGetRootPath() : undefined,
11681172
})
11691173
11701174
await axios.delete(url)

0 commit comments

Comments
 (0)