mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-24 17:38:37 -06:00
handles the port in the ip #14085
This commit is contained in:
parent
ad95760ead
commit
217a9edb4c
@ -17,7 +17,7 @@ def get_client_ip(request, additional_headers=()):
|
|||||||
)
|
)
|
||||||
for header in HTTP_HEADERS:
|
for header in HTTP_HEADERS:
|
||||||
if header in request.META:
|
if header in request.META:
|
||||||
client_ip = request.META[header].split(',')[0]
|
client_ip = request.META[header].split(',')[0].partition(':')[0]
|
||||||
try:
|
try:
|
||||||
return IPAddress(client_ip)
|
return IPAddress(client_ip)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
|
Loading…
Reference in New Issue
Block a user