passport-oauth2+1.6.1.patch 759 B

12345678910111213
  1. diff --git a/node_modules/passport-oauth2/lib/utils.js b/node_modules/passport-oauth2/lib/utils.js
  2. index 486f9e1..4584507 100644
  3. --- a/node_modules/passport-oauth2/lib/utils.js
  4. +++ b/node_modules/passport-oauth2/lib/utils.js
  5. @@ -24,7 +24,7 @@ exports.originalURL = function(req, options) {
  6. var trustProxy = options.proxy;
  7. var proto = (req.headers['x-forwarded-proto'] || '').toLowerCase()
  8. - , tls = req.connection.encrypted || (trustProxy && 'https' == proto.split(/\s*,\s*/)[0])
  9. + , tls = (req.connection && req.connection.encrypted) || (trustProxy && 'https' == proto.split(/\s*,\s*/)[0])
  10. , host = (trustProxy && req.headers['x-forwarded-host']) || req.headers.host
  11. , protocol = tls ? 'https' : 'http'
  12. , path = req.url || '';