소스 검색

handles the port in the ip #14085

Abhimanyu Saharan 2 년 전
부모
커밋
217a9edb4c
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      netbox/utilities/request.py

+ 1 - 1
netbox/utilities/request.py

@@ -17,7 +17,7 @@ def get_client_ip(request, additional_headers=()):
     )
     for header in HTTP_HEADERS:
         if header in request.META:
-            client_ip = request.META[header].split(',')[0]
+            client_ip = request.META[header].split(',')[0].partition(':')[0]
             try:
                 return IPAddress(client_ip)
             except ValueError: