mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-07 18:31:04 +00:00
perf: get request ip, only using x-forwarded-for
This commit is contained in:
@@ -155,10 +155,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]
|
||||||
|
Reference in New Issue
Block a user