Skip to content
This repository has been archived by the owner on Jun 5, 2024. It is now read-only.

Bugfix propfind response cut off #1032

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions changelog/unreleased/bugfix-propfind-response-cutoff
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Bugfix: Dav propfind response cut off

We've fixed an issue where the propfind response was incomplete
and some child values were beeing cut off

https://github.com/owncloud/owncloud-sdk/pull/1032
38 changes: 1 addition & 37 deletions src/dav.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,43 +260,7 @@ export class Dav {
* @return {string|Array} text content as string or array of subnodes, excluding text nodes
*/
_parsePropNode (propNode) {
var content = null
if (propNode.constructor === Object) {
if (Object.keys(propNode).length === 0) {
return ''
}
var subNodes = []
// Propnode can be any one of these
// { 'oc:share-type': [ '0', '3' ] }
// { 'oc:share-type': '3' }
// { 'd:collection': {} }
for (var key in propNode) {
var node = propNode[key]
if (typeof node !== 'object') {
subNodes.push(node)
continue
}
if (Array.isArray(node)) {
for (var item of node) {
subNodes.push(item)
}
continue
}
var nsComponent = key.split(':')[0]
var localComponent = key.split(':')[1]
var nsValue = this.xmlNamespacesComponents[nsComponent]
subNodes.push('{' + nsValue + '}' + localComponent)
}
if (subNodes.length) {
content = subNodes
}
} else if (propNode) {
content = propNode
} else {
content = ''
}

return content
return propNode
}

/**
Expand Down