overleaf/server-ce/hotfix/4.1.6/patches/forwarded+0.2.0.patch
Miguel Serrano 9eb8743014 Merge pull request #15531 from overleaf/msm-sp-hotfix-4-1-6
[CE/SP] Hotfix 4.1.6

GitOrigin-RevId: dc023665d5e0868913eff2104de1acaf7038cb9f
2023-11-02 08:53:07 +00:00

13 lines
415 B
Diff

diff --git a/node_modules/forwarded/index.js b/node_modules/forwarded/index.js
index b2b6bdd..75e6254 100644
--- a/node_modules/forwarded/index.js
+++ b/node_modules/forwarded/index.js
@@ -46,7 +46,7 @@ function forwarded (req) {
function getSocketAddr (req) {
return req.socket
? req.socket.remoteAddress
- : req.connection.remoteAddress
+ : req.connection && req.connection.remoteAddress
}
/**