Unify auth handling in the Host class
- flatten auth config to an Authorization header when the Host is created - remove individual Authorization handling from connectors - removed incomplete support for per-request auth - use per-request headers to provide your own Authorization header per request
This commit is contained in:
@ -72,10 +72,10 @@ describe('Http Connector', function () {
|
||||
var con = new HttpConnection(host, {});
|
||||
var reqParams = con.makeReqParams();
|
||||
|
||||
expect(reqParams).to.not.have.property('auth');
|
||||
expect(reqParams).to.eql({
|
||||
method: 'GET',
|
||||
protocol: 'http:',
|
||||
auth: 'john:dude',
|
||||
hostname: 'pizza.com',
|
||||
port: 9200,
|
||||
path: '/pizza/cheese?shrooms=true',
|
||||
@ -142,7 +142,6 @@ describe('Http Connector', function () {
|
||||
expect(reqParams).to.eql({
|
||||
method: 'PUT',
|
||||
protocol: 'http:',
|
||||
auth: null,
|
||||
hostname: 'google.com',
|
||||
port: 80,
|
||||
path: '/stuff',
|
||||
|
||||
Reference in New Issue
Block a user