api/keys: fix prefix size calculation for individual ipv6 addresses
This commit is contained in:
parent
9f4f03ec6c
commit
7c0fb16fdb
1 changed files with 3 additions and 1 deletions
|
@ -99,7 +99,9 @@ const formatKeys = (keyData) => {
|
||||||
if (data.ips) {
|
if (data.ips) {
|
||||||
formatted[key].ips = data.ips.map(addr => {
|
formatted[key].ips = data.ips.map(addr => {
|
||||||
if (ip.isValid(addr)) {
|
if (ip.isValid(addr)) {
|
||||||
return [ ip.parse(addr), 32 ];
|
const parsed = ip.parse(addr);
|
||||||
|
const range = parsed.kind() === 'ipv6' ? 128 : 32;
|
||||||
|
return [ parsed, range ];
|
||||||
}
|
}
|
||||||
|
|
||||||
return ip.parseCIDR(addr);
|
return ip.parseCIDR(addr);
|
||||||
|
|
Loading…
Reference in a new issue