Skip to content

Commit 69b0b7c

Browse files
committed
Merge pull request #211 from zedgu/master
Fix #196 #207 (Removes some un-needed calls to tls/crypto)
2 parents bfa43b4 + 47e50fe commit 69b0b7c

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

lib/oauth2.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ exports.OAuth2.prototype._chooseHttpLibrary= function( parsedUrl ) {
6060

6161
exports.OAuth2.prototype._request= function(method, url, headers, post_body, access_token, callback) {
6262

63-
var creds = crypto.createCredentials({ });
6463
var parsedUrl= URL.parse( url, true );
6564
if( parsedUrl.protocol == "https:" && !parsedUrl.port ) {
6665
parsedUrl.port= 443;

tests/oauth2.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
var vows = require('vows'),
22
assert = require('assert'),
3-
https = require('https'),
43
OAuth2= require('../lib/oauth2').OAuth2,
54
url = require('url');
65

@@ -210,5 +209,14 @@ vows.describe('OAuth2').addBatch({
210209
oa.get("", {});
211210
}
212211
}
212+
},
213+
'HTTPS URL connection testing, ': {
214+
topic: function() {
215+
var oa = new OAuth2("clientId", "clientSecret");
216+
oa._request('GET', 'https://www.bing.com/', {}, null, '', this.callback);
217+
},
218+
'we should correctly get the response code == 200': function(error, result, response) {
219+
assert.equal(response.statusCode, 200);
220+
}
213221
}
214222
}).export(module);

0 commit comments

Comments
 (0)