Skip to content

Commit

Permalink
Fixed the name of the namespace of the elements added when not found …
Browse files Browse the repository at this point in the history
…in a PROPFIND request/response
  • Loading branch information
AdrienCastex committed Apr 23, 2018
1 parent 4f91a11 commit 1b2b9cc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 28 deletions.
21 changes: 6 additions & 15 deletions lib/server/v2/commands/Propfind.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,16 +109,7 @@ var default_1 = (function () {
for (var _i = 0, _a = reqBody.leftElements; _i < _a.length; _i++) {
var el = _a[_i];
if (el) {
var name_1 = el.name;
var attributes = undefined;
var namespaceSeparatorIndex = name_1.indexOf(':');
if (namespaceSeparatorIndex >= 0) {
attributes = {
'xmlns:x': name_1.substring(0, namespaceSeparatorIndex)
};
name_1 = 'x:' + name_1.substring(namespaceSeparatorIndex + 1);
}
prop_2.ele(name_1, attributes);
prop_2.add(el);
}
}
}
Expand Down Expand Up @@ -263,11 +254,11 @@ var default_1 = (function () {
pm.getProperties(function (e, properties) {
if (e)
return nbOut(e);
for (var name_2 in properties) {
if (reqBody.mustDisplay(name_2)) {
var tag = prop.ele(name_2);
if (reqBody.mustDisplayValue(name_2)) {
var property = properties[name_2];
for (var name_1 in properties) {
if (reqBody.mustDisplay(name_1)) {
var tag = prop.ele(name_1);
if (reqBody.mustDisplayValue(name_1)) {
var property = properties[name_1];
if (tag.attributes)
for (var attName in property.attributes)
tag.attributes[attName] = property.attributes[attName];
Expand Down
14 changes: 1 addition & 13 deletions src/server/v2/commands/Propfind.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,19 +154,7 @@ export default class implements HTTPMethod
{
if(el)
{
let name = el.name;
let attributes = undefined;

const namespaceSeparatorIndex = name.indexOf(':');
if(namespaceSeparatorIndex >= 0)
{
attributes = {
'xmlns:x': name.substring(0, namespaceSeparatorIndex)
};
name = 'x:' + name.substring(namespaceSeparatorIndex + 1);
}

prop.ele(name, attributes);
prop.add(el);
}
}
}
Expand Down

0 comments on commit 1b2b9cc

Please sign in to comment.