mirror of
https://github.com/nextcloud/server.git
synced 2026-06-10 09:13:19 -04:00
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
3978e056cf.
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
This commit is contained in:
parent
dbf1b69717
commit
ed8bd0a8ef
1 changed files with 2 additions and 2 deletions
|
|
@ -7,6 +7,7 @@ import type { FileStat, ResponseDataDetailed } from 'webdav'
|
|||
|
||||
import { CancelablePromise } from 'cancelable-promise'
|
||||
import { davGetDefaultPropfind, davResultToNode, davRootPath } from '@nextcloud/files'
|
||||
import { join } from 'path'
|
||||
import { client } from './WebdavClient.ts'
|
||||
import logger from '../logger.ts'
|
||||
|
||||
|
|
@ -17,11 +18,10 @@ import logger from '../logger.ts'
|
|||
export const resultToNode = (node: FileStat): Node => davResultToNode(node)
|
||||
|
||||
export const getContents = (path = '/'): CancelablePromise<ContentsWithRoot> => {
|
||||
path = join(davRootPath, path)
|
||||
const controller = new AbortController()
|
||||
const propfindPayload = davGetDefaultPropfind()
|
||||
|
||||
path = `${davRootPath}${path}`
|
||||
|
||||
return new CancelablePromise(async (resolve, reject, onCancel) => {
|
||||
onCancel(() => controller.abort())
|
||||
try {
|
||||
|
|
|
|||
Loading…
Reference in a new issue