mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-07 05:31:15 -07:00
Fix 127.0.0.1 showing as external IP address on tables
This commit is contained in:
parent
2f5f0ba1e1
commit
f86c9ea947
1 changed files with 2 additions and 1 deletions
|
@ -242,7 +242,8 @@ function isPrivateIP(ip_address) {
|
||||||
// get IPv4 mapped address (xxx.xxx.xxx.xxx) from IPv6 addresss (::ffff:xxx.xxx.xxx.xxx)
|
// get IPv4 mapped address (xxx.xxx.xxx.xxx) from IPv6 addresss (::ffff:xxx.xxx.xxx.xxx)
|
||||||
var parts = ip_address.split(":");
|
var parts = ip_address.split(":");
|
||||||
var parts = parts[parts.length - 1].split('.');
|
var parts = parts[parts.length - 1].split('.');
|
||||||
if (parts[0] === '10' ||
|
if ((parts[0] === '127' && parts[1] === '0' && parts[2] === '0' && parts[3] === '1') ||
|
||||||
|
(parts[0] === '10') ||
|
||||||
(parts[0] === '172' && (parseInt(parts[1], 10) >= 16 && parseInt(parts[1], 10) <= 31)) ||
|
(parts[0] === '172' && (parseInt(parts[1], 10) >= 16 && parseInt(parts[1], 10) <= 31)) ||
|
||||||
(parts[0] === '192' && parts[1] === '168')) {
|
(parts[0] === '192' && parts[1] === '168')) {
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue