From 4f1826d3ed410d990eb497d5affebda3a41c7084 Mon Sep 17 00:00:00 2001 From: ibuler Date: Tue, 12 Dec 2023 10:49:46 +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 add6b79b3..798b4a94c 100644 --- a/apps/common/utils/common.py +++ b/apps/common/utils/common.py @@ -155,10 +155,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]