aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--caldav.js12
-rw-r--r--lib/caldav/sax/dav_response.js12
-rw-r--r--samples/xml/propget.xml7
-rw-r--r--test/caldav/sax/dav_response_test.js7
4 files changed, 7 insertions, 31 deletions
diff --git a/caldav.js b/caldav.js
index fda846e..7f3d367 100644
--- a/caldav.js
+++ b/caldav.js
@@ -2527,8 +2527,7 @@ function write (chunk) {
oncomplete: function() {
var propstat = this.stack[this.stack.length - 1];
- var hash = propstat.propstat;
-
+ propstat = propstat.propstat;
var key;
var status = this.current.status;
var props = this.current.prop;
@@ -2536,21 +2535,14 @@ function write (chunk) {
delete this.current.status;
delete this.current.prop;
- var hasProps = false;
-
for (key in props) {
- hasProps = true;
if (Object.hasOwnProperty.call(props, key)) {
- hash[key] = {
+ propstat[key] = {
status: status,
value: props[key]
};
}
}
-
- if (!hasProps) {
- propstat.propstat = false;
- }
}
});
diff --git a/lib/caldav/sax/dav_response.js b/lib/caldav/sax/dav_response.js
index f168d97..69a4368 100644
--- a/lib/caldav/sax/dav_response.js
+++ b/lib/caldav/sax/dav_response.js
@@ -165,8 +165,7 @@
oncomplete: function() {
var propstat = this.stack[this.stack.length - 1];
- var hash = propstat.propstat;
-
+ propstat = propstat.propstat;
var key;
var status = this.current.status;
var props = this.current.prop;
@@ -174,21 +173,14 @@
delete this.current.status;
delete this.current.prop;
- var hasProps = false;
-
for (key in props) {
- hasProps = true;
if (Object.hasOwnProperty.call(props, key)) {
- hash[key] = {
+ propstat[key] = {
status: status,
value: props[key]
};
}
}
-
- if (!hasProps) {
- propstat.propstat = false;
- }
}
});
diff --git a/samples/xml/propget.xml b/samples/xml/propget.xml
index dd20c91..2db1aa2 100644
--- a/samples/xml/propget.xml
+++ b/samples/xml/propget.xml
@@ -2,13 +2,6 @@
<D:multistatus xmlns:D="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav">
<D:response>
- <D:href>/calendar/fake/</D:href>
- <D:propstat>
- <D:status>HTTP/1.1 404 Not Found</D:status>
- </D:propstat>
- </D:response>
-
- <D:response>
<D:href>/calendar/user/</D:href>
diff --git a/test/caldav/sax/dav_response_test.js b/test/caldav/sax/dav_response_test.js
index dd2ecdd..3825043 100644
--- a/test/caldav/sax/dav_response_test.js
+++ b/test/caldav/sax/dav_response_test.js
@@ -83,9 +83,8 @@ suite('caldav/sax/dav_response', function() {
});
expected = {
- '/calendar/fake/': false,
-
'/calendar/user/': {
+
'principal-URL': {
status: '200',
value: {
@@ -136,7 +135,7 @@ suite('caldav/sax/dav_response', function() {
'/calendar/user/',
expected['/calendar/user/']
],
- response[1],
+ response[0],
'/calendar/user/ response'
);
@@ -145,7 +144,7 @@ suite('caldav/sax/dav_response', function() {
'/calendar/other',
expected['/calendar/other']
],
- response[2],
+ response[1],
'/calendar/other/ response'
);