Skip to content

Commit ed8bd0a

Browse files
committed
fix: use the join function for merging davRootPath and path
Using the join function ensures, that also paths without a leading slash a properly merged together. Extracted from 3978e05. Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
1 parent dbf1b69 commit ed8bd0a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

apps/files/src/services/Files.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import type { FileStat, ResponseDataDetailed } from 'webdav'
77

88
import { CancelablePromise } from 'cancelable-promise'
99
import { davGetDefaultPropfind, davResultToNode, davRootPath } from '@nextcloud/files'
10+
import { join } from 'path'
1011
import { client } from './WebdavClient.ts'
1112
import logger from '../logger.ts'
1213

@@ -17,11 +18,10 @@ import logger from '../logger.ts'
1718
export const resultToNode = (node: FileStat): Node => davResultToNode(node)
1819

1920
export const getContents = (path = '/'): CancelablePromise<ContentsWithRoot> => {
21+
path = join(davRootPath, path)
2022
const controller = new AbortController()
2123
const propfindPayload = davGetDefaultPropfind()
2224

23-
path = `${davRootPath}${path}`
24-
2525
return new CancelablePromise(async (resolve, reject, onCancel) => {
2626
onCancel(() => controller.abort())
2727
try {

0 commit comments

Comments
 (0)