From a4f5a62e5199687a45f24ebb9d43915ab2289ecf Mon Sep 17 00:00:00 2001 From: vapao Date: Fri, 14 Oct 2022 09:41:34 +0800 Subject: [PATCH] =?UTF-8?q?U=20=E4=BC=98=E5=8C=96=E5=85=BC=E5=AE=B9?= =?UTF-8?q?=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spug_api/libs/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spug_api/libs/utils.py b/spug_api/libs/utils.py index aba6f99..0b25168 100644 --- a/spug_api/libs/utils.py +++ b/spug_api/libs/utils.py @@ -131,4 +131,5 @@ def get_request_real_ip(headers: dict): x_real_ip = headers.get('x-forwarded-for') if not x_real_ip: x_real_ip = headers.get('x-real-ip', '') - return x_real_ip.split(',')[0] + x_real_ip = x_real_ip.split(',')[0] + return x_real_ip.split(':')[0]