Detecting 127.0.0.1 and making sure X-Forwarded exists, fixes #94
This commit is contained in:
@ -12,7 +12,7 @@ from handlers import WebsocketHandler, HttpHandler
|
||||
from core import IrisCore
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
__version__ = '2.13.9'
|
||||
__version__ = '2.13.10'
|
||||
|
||||
##
|
||||
# Core extension class
|
||||
|
||||
@ -44,9 +44,9 @@ class WebsocketHandler(tornado.websocket.WebSocketHandler):
|
||||
created = datetime.strftime(datetime.now(), '%Y-%m-%d %H:%M:%S')
|
||||
|
||||
# get our IP
|
||||
# if it's local, then use our proxy origin
|
||||
# if it's local, then check for proxy origin
|
||||
ip = self.request.remote_ip
|
||||
if (ip == '127.0.0.1'):
|
||||
if (ip == '127.0.0.1' and hasattr(self.request.headers,'X-Forwarded-For')):
|
||||
ip = self.request.headers['X-Forwarded-For']
|
||||
|
||||
# construct our client object, and add to our list of connections
|
||||
|
||||
Reference in New Issue
Block a user