mirror of https://github.com/jumpserver/jumpserver
fix(web exec) Web execute command log didn't get the real ip if behind the lb proxy.
fixedpull/189/head
parent
de594aebd5
commit
77c7f8fb54
|
@ -233,7 +233,9 @@ class ExecHandler(tornado.websocket.WebSocketHandler):
|
|||
def open(self):
|
||||
logger.debug('Websocket: Open exec request')
|
||||
role_name = self.get_argument('role', 'sb')
|
||||
self.remote_ip = self.request.remote_ip
|
||||
self.term.remote_ip = self.request.headers.get("X-Real-IP")
|
||||
if not self.term.remote_ip:
|
||||
self.term.remote_ip = self.request.remote_ip
|
||||
logger.debug('Web执行命令: 请求系统用户 %s' % role_name)
|
||||
self.role = get_object(PermRole, name=role_name)
|
||||
self.perm = get_group_user_perm(self.user)
|
||||
|
|
Loading…
Reference in New Issue