Description
> Address6.fromURL('http://1234:5678::abcdxyz');
{
address: Address6 {
addressMinusSuffix: '1234:5678::abcd',
parsedSubnet: '',
subnet: '/128',
subnetMask: 128,
v4: false,
zone: '',
isInSubnet: [Function: isInSubnet],
isCorrect: [Function (anonymous)],
groups: 8,
address: '1234:5678::abcd',
elidedGroups: 5,
elisionBegin: 2,
elisionEnd: 7,
parsedAddress: [
'1234', '5678',
'0', '0',
'0', '0',
'0', 'abcd'
]
},
port: null
}
> Address6.fromURL('http://[1234:5678::abcdxyz]');
{
address: Address6 {
addressMinusSuffix: '1234:5678::abcd',
parsedSubnet: '',
subnet: '/128',
subnetMask: 128,
v4: false,
zone: '',
isInSubnet: [Function: isInSubnet],
isCorrect: [Function (anonymous)],
groups: 8,
address: '1234:5678::abcd',
elidedGroups: 5,
elisionBegin: 2,
elisionEnd: 7,
parsedAddress: [
'1234', '5678',
'0', '0',
'0', '0',
'0', 'abcd'
]
},
port: null
}
I.e. the trailing "xyz" (in both cases) is truncated to extract a valid address from the sub-string before it. The valid sub-string and the invalid suffix can be generalised (beyond the above examples).
Not sure if this is a bug, or expected behaviour. Regardless, it was unexpected for me.
Description
I.e. the trailing "xyz" (in both cases) is truncated to extract a valid address from the sub-string before it. The valid sub-string and the invalid suffix can be generalised (beyond the above examples).
Not sure if this is a bug, or expected behaviour. Regardless, it was unexpected for me.