aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@protonmail.com>2024-02-03 12:39:43 +0100
committernextcloud-command <nextcloud-command@users.noreply.github.com>2024-02-05 14:48:24 +0000
commit77f307bafdbb04cb1165d9a3c1a09a242d43f856 (patch)
tree21337e00000b92b7c4c7112c6b4eb2a783ba7d5c /apps
parenta026048050765f2dfa84fd86184c98a361bb49a7 (diff)
downloadnextcloud-server-77f307bafdbb04cb1165d9a3c1a09a242d43f856.tar.gz
nextcloud-server-77f307bafdbb04cb1165d9a3c1a09a242d43f856.zip
fix(files): dav owner and mime types
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com> Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
Diffstat (limited to 'apps')
-rw-r--r--apps/files/src/services/Files.ts9
1 files changed, 7 insertions, 2 deletions
diff --git a/apps/files/src/services/Files.ts b/apps/files/src/services/Files.ts
index a293154f625..bcfb368882d 100644
--- a/apps/files/src/services/Files.ts
+++ b/apps/files/src/services/Files.ts
@@ -40,9 +40,14 @@ interface ResponseProps extends DAVResultResponseProps {
}
export const resultToNode = function(node: FileStat): File | Folder {
+ const userId = getCurrentUser()?.uid
+ if (!userId) {
+ throw new Error('No user id found')
+ }
+
const props = node.props as ResponseProps
const permissions = davParsePermissions(props?.permissions)
- const owner = (props['owner-id'] || getCurrentUser()?.uid) as string
+ const owner = (props['owner-id'] || userId).toString()
const source = generateRemoteUrl('dav' + rootPath + node.filename)
const id = props?.fileid < 0
@@ -53,7 +58,7 @@ export const resultToNode = function(node: FileStat): File | Folder {
id,
source,
mtime: new Date(node.lastmod),
- mime: node.mime as string,
+ mime: node.mime || 'application/octet-stream',
size: props?.size as number || 0,
permissions,
owner,