mirror of https://github.com/jumpserver/jumpserver
perf: get request ip, only using x-forwarded-for
parent
caa6219382
commit
c5299b64cb
|
@ -153,10 +153,6 @@ def is_uuid(seq):
|
||||||
|
|
||||||
|
|
||||||
def get_request_ip(request):
|
def get_request_ip(request):
|
||||||
x_real_ip = request.META.get('HTTP_X_REAL_IP', '')
|
|
||||||
if x_real_ip:
|
|
||||||
return x_real_ip
|
|
||||||
|
|
||||||
x_forwarded_for = request.META.get('HTTP_X_FORWARDED_FOR', '').split(',')
|
x_forwarded_for = request.META.get('HTTP_X_FORWARDED_FOR', '').split(',')
|
||||||
if x_forwarded_for and x_forwarded_for[0]:
|
if x_forwarded_for and x_forwarded_for[0]:
|
||||||
login_ip = x_forwarded_for[0]
|
login_ip = x_forwarded_for[0]
|
||||||
|
|
Loading…
Reference in New Issue