mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-22 00:16:15 -04:00
updated to use settings
updated handler/SocketIORouter.js to use new setting updated hooks/express.js to use new setting updated utils/Settings.js to accept new setting updated settings.json.template so new setting is present
This commit is contained in:
parent
6ea5efbcc3
commit
fb0bc31056
4 changed files with 20 additions and 7 deletions
|
@ -23,6 +23,7 @@ var ERR = require("async-stacktrace");
|
|||
var log4js = require('log4js');
|
||||
var messageLogger = log4js.getLogger("message");
|
||||
var securityManager = require("../db/SecurityManager");
|
||||
var settings = require('../utils/Settings');
|
||||
|
||||
/**
|
||||
* Saves all components
|
||||
|
@ -55,12 +56,12 @@ exports.setSocketIO = function(_socket)
|
|||
|
||||
socket.sockets.on('connection', function(client)
|
||||
{
|
||||
if(client.handshake.headers['x-forwarded-for'] === undefined){
|
||||
client.set('remoteAddress', client.handshake.address.address);
|
||||
}
|
||||
else{
|
||||
client.set('remoteAddress', client.handshake.headers['x-forwarded-for']);
|
||||
}
|
||||
if(settings.trustProxy && client.handshake.headers['x-forwarded-for'] !== undefined){
|
||||
client.set('remoteAddress', client.handshake.headers['x-forwarded-for']);
|
||||
}
|
||||
else{
|
||||
client.set('remoteAddress', client.handshake.address.address);
|
||||
}
|
||||
var clientAuthorized = false;
|
||||
|
||||
//wrap the original send function to log the messages
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue