Comparing version 1.0.1 to 1.0.2
@@ -94,3 +94,22 @@ /* OpenID for node.js | ||
var _buffer = typeof(Buffer.from) === 'function' ? Buffer.from : function(str, enc) { return new Buffer(str, enc); }; | ||
// Find the most up-to-date and usable way to create buffers | ||
var _buffer = null; | ||
if (typeof(Buffer.from) === 'function') { | ||
// Some older Node versions throw an exception when | ||
// buffers with binary encoding are created using the | ||
// from function, so if that happens we have to resort | ||
// to constructor based creation. | ||
try { | ||
Buffer.from('openid', 'binary'); | ||
_buffer = Buffer.from; | ||
} | ||
catch(_) { | ||
} | ||
} | ||
if (_buffer === null) { | ||
// Either the Node version is too old to have a Buffer.from, | ||
// or the Buffer.from call failed with binary encoding. | ||
// Either way, use the (deprecated from node v6) constructor. | ||
_buffer = function(str, enc) { return new Buffer(str, enc); }; | ||
} | ||
@@ -97,0 +116,0 @@ var _base64encode = function(str) { |
@@ -21,3 +21,3 @@ { | ||
}, | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"repository": { | ||
@@ -24,0 +24,0 @@ "type": "git", |
@@ -56,5 +56,5 @@ /* A simple sample demonstrating OpenID for node.js | ||
var relyingParty = new openid.RelyingParty( | ||
'http://localhost:8080/verify', // Verification URL (yours) | ||
'http://localhost:8080/', // Realm (optional, specifies realm for OpenID authentication) | ||
true, // Use stateless verification | ||
'http://example.com/verify', // Verification URL (yours) | ||
null, // Realm (optional, specifies realm for OpenID authentication) | ||
false, // Use stateless verification | ||
false, // Strict mode | ||
@@ -130,2 +130,2 @@ extensions); // List of extensions to enable and include | ||
}); | ||
server.listen(8080); | ||
server.listen(80); |
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
291202
2072