Skip to content

Commit 188867d

Browse files
committed
handles the port in the ip #14085
1 parent 57bf2a2 commit 188867d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

netbox/utilities/request.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def get_client_ip(request, additional_headers=()):
1717
)
1818
for header in HTTP_HEADERS:
1919
if header in request.META:
20-
client_ip = request.META[header].split(',')[0]
20+
client_ip = request.META[header].split(',')[0].partition(':')[0]
2121
try:
2222
return IPAddress(client_ip)
2323
except ValueError:

0 commit comments

Comments
 (0)