Fix XML parsing for WebDav
This was a regression caused by the `@libs/xml` upgrade in v2.6.0
This commit is contained in:
@@ -12,7 +12,7 @@ export function addDavPrefixToKeys(object: Record<string, any>, prefix = 'D:'):
|
||||
|
||||
if (typeof object === 'object' && object !== null) {
|
||||
return Object.entries(object).reduce((reducedObject, [key, value]) => {
|
||||
const prefixedKey = key === 'xml' || key.startsWith('#') || key.startsWith('@') ? key : `${prefix}${key}`;
|
||||
const prefixedKey = key.startsWith('#') || key.startsWith('@') ? key : `${prefix}${key}`;
|
||||
reducedObject[prefixedKey] = addDavPrefixToKeys(value);
|
||||
return reducedObject;
|
||||
}, {} as Record<string, any>);
|
||||
@@ -105,10 +105,8 @@ export async function buildPropFindResponse(
|
||||
const filePaths = await getFilePaths(join(rootPath, queryPath), depth);
|
||||
|
||||
const response: Record<string, any> = {
|
||||
xml: {
|
||||
'@version': '1.0',
|
||||
'@encoding': 'UTF-8',
|
||||
},
|
||||
'@version': '1.0',
|
||||
'@encoding': 'UTF-8',
|
||||
multistatus: {
|
||||
'@xmlns:D': 'DAV:',
|
||||
response: [],
|
||||
|
||||
Reference in New Issue
Block a user