tests/oauth2.js [remove] https never used [add] https url testing lib/oauth2.js [remove] creds never used
This commit is contained in:
parent
bfa43b44e7
commit
47e50fe3ce
@ -60,7 +60,6 @@ exports.OAuth2.prototype._chooseHttpLibrary= function( parsedUrl ) {
|
|||||||
|
|
||||||
exports.OAuth2.prototype._request= function(method, url, headers, post_body, access_token, callback) {
|
exports.OAuth2.prototype._request= function(method, url, headers, post_body, access_token, callback) {
|
||||||
|
|
||||||
var creds = crypto.createCredentials({ });
|
|
||||||
var parsedUrl= URL.parse( url, true );
|
var parsedUrl= URL.parse( url, true );
|
||||||
if( parsedUrl.protocol == "https:" && !parsedUrl.port ) {
|
if( parsedUrl.protocol == "https:" && !parsedUrl.port ) {
|
||||||
parsedUrl.port= 443;
|
parsedUrl.port= 443;
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
var vows = require('vows'),
|
var vows = require('vows'),
|
||||||
assert = require('assert'),
|
assert = require('assert'),
|
||||||
https = require('https'),
|
|
||||||
OAuth2= require('../lib/oauth2').OAuth2,
|
OAuth2= require('../lib/oauth2').OAuth2,
|
||||||
url = require('url');
|
url = require('url');
|
||||||
|
|
||||||
@ -210,5 +209,14 @@ vows.describe('OAuth2').addBatch({
|
|||||||
oa.get("", {});
|
oa.get("", {});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
'HTTPS URL connection testing, ': {
|
||||||
|
topic: function() {
|
||||||
|
var oa = new OAuth2("clientId", "clientSecret");
|
||||||
|
oa._request('GET', 'https://www.bing.com/', {}, null, '', this.callback);
|
||||||
|
},
|
||||||
|
'we should correctly get the response code == 200': function(error, result, response) {
|
||||||
|
assert.equal(response.statusCode, 200);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}).export(module);
|
}).export(module);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user