perf: get request ip, only using x-forwarded-for

v2.28
halo 2024-12-25 22:16:30 +08:00 committed by Eric_Lee
parent caa6219382
commit c5299b64cb
1 changed files with 0 additions and 4 deletions

View File

@ -153,10 +153,6 @@ def is_uuid(seq):
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(',')
if x_forwarded_for and x_forwarded_for[0]:
login_ip = x_forwarded_for[0]