mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 20:16:04 +01:00
socket.handshake.address may not always be defined, thanks @psychobunny
This commit is contained in:
@@ -22,7 +22,7 @@ var async = require('async'),
|
|||||||
referer = headers['referer'];
|
referer = headers['referer'];
|
||||||
|
|
||||||
return {
|
return {
|
||||||
ip: headers['x-forwarded-for'] || socket.handshake.address.address,
|
ip: headers['x-forwarded-for'] || (socket.handshake.address || {}).address,
|
||||||
host: host,
|
host: host,
|
||||||
protocol: headers['secure'] ? 'https' : 'http',
|
protocol: headers['secure'] ? 'https' : 'http',
|
||||||
secure: !!headers['secure'],
|
secure: !!headers['secure'],
|
||||||
|
|||||||
Reference in New Issue
Block a user