From c5299b64cb93308f2027e0c7fa913c0b57cfbb24 Mon Sep 17 00:00:00 2001 From: halo Date: Wed, 25 Dec 2024 22:16:30 +0800 Subject: [PATCH] perf: get request ip, only using x-forwarded-for --- apps/common/utils/common.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/apps/common/utils/common.py b/apps/common/utils/common.py index c198a0ad2..b6bff2a8b 100644 --- a/apps/common/utils/common.py +++ b/apps/common/utils/common.py @@ -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]