Comparing version 0.9.14 to 0.9.15
@@ -18,4 +18,13 @@ var querystring= require('querystring'), | ||
this._useAuthorizationHeaderForGET= false; | ||
} | ||
//our agent | ||
this._agent = undefined; | ||
}; | ||
// Allows you to set an agent to use instead of the default HTTP or | ||
// HTTPS agents. Useful when dealing with your own certificates. | ||
exports.OAuth2.prototype.setAgent = function(agent) { | ||
this._agent = agent; | ||
}; | ||
// This 'hack' method is required for sites that don't use | ||
@@ -133,2 +142,7 @@ // 'access_token' as the name of the access token (for requests). | ||
//set the agent on the request options | ||
if (this._agent) { | ||
options.agent = this._agent; | ||
} | ||
var request = http_library.request(options); | ||
@@ -135,0 +149,0 @@ request.on('response', function (response) { |
{ "name" : "oauth" | ||
, "description" : "Library for interacting with OAuth 1.0, 1.0A, 2 and Echo. Provides simplified client access and allows for construction of more complex apis and OAuth providers." | ||
, "version" : "0.9.14" | ||
, "version" : "0.9.15" | ||
, "directories" : { "lib" : "./lib" } | ||
@@ -14,7 +14,3 @@ , "main" : "index.js" | ||
} | ||
, "licenses" : | ||
[ { "type" : "MIT" | ||
, "url" : "http://github.com/ciaranj/node-oauth/raw/master/LICENSE" | ||
} | ||
] | ||
, "license": "MIT" | ||
} |
@@ -81,2 +81,4 @@ node-oauth | ||
============== | ||
* 0.9.15 | ||
- OAuth2: Allow specification of agent | ||
* 0.9.14 | ||
@@ -189,1 +191,2 @@ - OAuth2: Extend 'successful' token responses to include anything in the 2xx range. | ||
* AJ ONeal | ||
* Philip Skinner - https://github.com/PhilipSkinner |
@@ -289,3 +289,17 @@ var vows = require('vows'), | ||
} | ||
}, | ||
'When specifying an agent, that agent is passed to the HTTP request method' : { | ||
topic : new OAuth2('clientId', 'clientSecret', undefined, undefined, undefined, undefined), | ||
'When calling _executeRequest': { | ||
'we whould see the agent being put into the options' : function(oa) { | ||
oa.setAgent('awesome agent'); | ||
oa._executeRequest({ | ||
request : function(options, cb) { | ||
assert.equal(options.agent, 'awesome agent'); | ||
return new DummyRequest(new DummyResponse(200)); | ||
} | ||
}, {}, null, function() {}); | ||
} | ||
} | ||
} | ||
}).export(module); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
129503
21
2694
191