소스 검색

아이피 두개로 나오는 버그 수정

Surplus_Up (2DU) 6 년 전
부모
커밋
f637de8bfb
1개의 변경된 파일5개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      route/tool/set_mark/tool.py

+ 5 - 0
route/tool/set_mark/tool.py

@@ -27,9 +27,14 @@ def ip_check(d_type = 0):
     if ip == '':
         try:
             ip = flask.request.environ.get('HTTP_X_REAL_IP', flask.request.environ.get('HTTP_X_FORWARDED_FOR', flask.request.remote_addr))
+            if type(ip) == type([]):
+                ip = ip[0]
 
             if ip == '::1' or ip == '127.0.0.1':
                 ip = flask.request.environ.get('HTTP_X_FORWARDED_FOR', flask.request.remote_addr)
+
+                if type(ip) == type([]):
+                    ip = ip[0]
         except:
             ip = 'error:ip'