Merge pull request #2967 from thelounge/xpaw/fix-2966

Add fallback ip address for unix sockets
This commit is contained in:
Pavel Djundik 2019-01-15 13:32:00 +02:00 committed by GitHub
commit 185fb9c71c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -226,7 +226,7 @@ function getClientLanguage(socket) {
}
function getClientIp(socket) {
let ip = socket.handshake.address;
let ip = socket.handshake.address || "127.0.0.1";
if (Helper.config.reverseProxy) {
const forwarded = (socket.request.headers["x-forwarded-for"] || "").split(/\s*,\s*/).filter(Boolean);