aboutsummaryrefslogtreecommitdiffstats
path: root/lib/caldav/http/basic_auth.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/caldav/http/basic_auth.js')
-rw-r--r--lib/caldav/http/basic_auth.js34
1 files changed, 34 insertions, 0 deletions
diff --git a/lib/caldav/http/basic_auth.js b/lib/caldav/http/basic_auth.js
new file mode 100644
index 0000000..07f083d
--- /dev/null
+++ b/lib/caldav/http/basic_auth.js
@@ -0,0 +1,34 @@
+(function(module, ns) {
+
+ var XHR = ns.require('xhr');
+
+ function BasicAuth(connection, options) {
+ // create a clone of options
+ var clone = Object.create(null);
+
+ if (typeof(options) !== 'undefined') {
+ for (var key in options) {
+ clone[key] = options[key];
+ }
+ }
+
+ clone.password = connection.password || clone.password;
+ clone.user = connection.user || clone.user;
+
+ XHR.call(this, clone);
+ }
+
+ BasicAuth.prototype = {
+ __proto__: XHR.prototype
+ };
+
+
+ module.exports = BasicAuth;
+
+}.apply(
+ this,
+ (this.Caldav) ?
+ [Caldav('http/basic_auth'), Caldav] :
+ [module, require('../caldav')]
+));
+