From b8154e5ca85de405f104057b93f5a50a1250b59f Mon Sep 17 00:00:00 2001 From: RogerWork Date: Wed, 20 Mar 2024 16:50:36 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E8=AF=95=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dingxin_toolbox_drf/http.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dingxin_toolbox_drf/http.py b/dingxin_toolbox_drf/http.py index 2b608fd..0387d23 100644 --- a/dingxin_toolbox_drf/http.py +++ b/dingxin_toolbox_drf/http.py @@ -9,10 +9,11 @@ class SetRemoteAddrFromForwardedFor(MiddlewareMixin): def process_request(self, request): print('process_request') + print("request.META") + print(request.META) try: print("request.META") real_ip = request.META['HTTP_X_FORWARDED_FOR'] - print(request.META) print('real_ip', real_ip) except KeyError as err: print('HTTP_X_FORWARDED_FOR key error')