mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-29 21:13:43 -05:00
f60e86a71d
[misc] add patches for gracefully handling missing req.socket/connection GitOrigin-RevId: fd0b067d5a4b5a96857ac94a577460b82bba7672
13 lines
759 B
Diff
13 lines
759 B
Diff
diff --git a/node_modules/passport-oauth2/lib/utils.js b/node_modules/passport-oauth2/lib/utils.js
|
|
index 486f9e1..4584507 100644
|
|
--- a/node_modules/passport-oauth2/lib/utils.js
|
|
+++ b/node_modules/passport-oauth2/lib/utils.js
|
|
@@ -24,7 +24,7 @@ exports.originalURL = function(req, options) {
|
|
var trustProxy = options.proxy;
|
|
|
|
var proto = (req.headers['x-forwarded-proto'] || '').toLowerCase()
|
|
- , tls = req.connection.encrypted || (trustProxy && 'https' == proto.split(/\s*,\s*/)[0])
|
|
+ , tls = (req.connection && req.connection.encrypted) || (trustProxy && 'https' == proto.split(/\s*,\s*/)[0])
|
|
, host = (trustProxy && req.headers['x-forwarded-host']) || req.headers.host
|
|
, protocol = tls ? 'https' : 'http'
|
|
, path = req.url || '';
|