From 2f7627e89ce3b4336435a0c0cb25119b2adc7a01 Mon Sep 17 00:00:00 2001 From: Fulton Byrne Date: Tue, 5 Jan 2016 14:01:41 -0500 Subject: [PATCH] options.auth passes straight through to request library. --- lib/cradle.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/cradle.js b/lib/cradle.js index 269f1ab..f827c32 100644 --- a/lib/cradle.js +++ b/lib/cradle.js @@ -100,9 +100,6 @@ cradle.Connection = function Connection(/* variable args */) { this.protocol = (this.options.secure) ? 'https' : 'http'; } - if (this.auth && this.auth.user) { // Deprecation warning - console.log('Warning: "user" & "pass" parameters ignored. Use "username" & "password"'); - } if (this.options.ssl) { // Deprecation warning console.log('Warning: "ssl" option is deprecated. Use "secure" instead.'); } @@ -141,7 +138,7 @@ cradle.Connection.prototype.rawRequest = function (options, callback) { // Set HTTP Basic Auth if (this.auth) { - options.headers['Authorization'] = "Basic " + new Buffer(this.auth.username + ':' + this.auth.password).toString('base64'); + options.auth = this.auth; } // Set client-wide headers