Skip to content

Commit

Permalink
Merge pull request #298 from Freyert/auth
Browse files Browse the repository at this point in the history
options.auth passes straight through to request library.
  • Loading branch information
panuhorsmalahti committed Jan 6, 2016
2 parents 55f951c + 2f7627e commit 599eaa2
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/cradle.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.');
}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 599eaa2

Please sign in to comment.