handle missing 'fly-client-ip' (#7814)

This commit is contained in:
chris48s
2022-04-05 20:29:28 +01:00
committed by GitHub
parent 4382706352
commit 8821ff85fc

View File

@@ -319,6 +319,8 @@ class Server {
// On Fly we can use the Fly-Client-IP header
// https://fly.io/docs/reference/runtime-environment/#request-headers
req.ip = req.headers['fly-client-ip']
? req.headers['fly-client-ip']
: req.socket.remoteAddress
} else {
req.ip = req.socket.remoteAddress
}