Detecting 127.0.0.1 and making sure X-Forwarded exists, fixes #94

This commit is contained in:
James Barnsley
2017-04-07 19:40:33 +12:00
parent fce7f7044f
commit 2bede68218
2 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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