diff --git a/dingxin_toolbox_drf/http.py b/dingxin_toolbox_drf/http.py index b904ad3..ce1fae2 100644 --- a/dingxin_toolbox_drf/http.py +++ b/dingxin_toolbox_drf/http.py @@ -10,7 +10,10 @@ class SetRemoteAddrFromForwardedFor(MiddlewareMixin): def process_request(self, request): try: real_ip = request.META['HTTP_X_FORWARDED_FOR'] + print("request.META") + print(request.META) except KeyError as err: print(err) else: real_ip = real_ip.split(",")[0] + request.META['REMOTE_ADDR'] = real_ip