aboutsummaryrefslogtreecommitdiffstats
path: root/lib/caldav/request/calendar_home.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/caldav/request/calendar_home.js')
-rw-r--r--lib/caldav/request/calendar_home.js13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/caldav/request/calendar_home.js b/lib/caldav/request/calendar_home.js
index 24b27bc..a1f8ca6 100644
--- a/lib/caldav/request/calendar_home.js
+++ b/lib/caldav/request/calendar_home.js
@@ -52,6 +52,10 @@
Propfind: ns.require('request/propfind'),
+ /**
+ * @return {Caldav.Xhr} The underlying xhr request so that the caller
+ * has a chance to abort the request.
+ */
_findPrincipal: function(url, callback) {
var find = new this.Propfind(this.connection, {
url: url
@@ -60,7 +64,7 @@
find.prop('current-user-principal');
find.prop('principal-URL');
- find.send(function(err, data) {
+ return find.send(function(err, data) {
var principal;
if (err) {
@@ -81,7 +85,6 @@
} else {
callback(new Errors.CaldavHttpError(404));
}
-
});
},
@@ -93,7 +96,7 @@
find.prop(['caldav', 'calendar-home-set']);
- find.send(function(err, data) {
+ return find.send(function(err, data) {
if (err) {
callback(err);
return;
@@ -112,10 +115,12 @@
*
* @param {Function} callback node style where second argument
* are the details of the home calendar.
+ * @return {Caldav.Xhr} The underlying xhr request so that the caller
+ * has a chance to abort the request.
*/
send: function(callback) {
var self = this;
- self._findPrincipal(self.url, function(err, url) {
+ return self._findPrincipal(self.url, function(err, url) {
if (!url) {
callback(err);