Accept IPv6 addresses in connectivity diagnostics
This commit is contained in:
@@ -282,7 +282,7 @@ function parseNetwork(body: string): Omit<NetworkProbeResult, 'attempts' | 'erro
|
|||||||
const value = record(JSON.parse(body));
|
const value = record(JSON.parse(body));
|
||||||
const connection = record(value.connection);
|
const connection = record(value.connection);
|
||||||
const address = text(value.ip);
|
const address = text(value.ip);
|
||||||
if (value.success === false || !address || net.isIP(address) !== 4) return null;
|
if (value.success === false || !address || net.isIP(address) === 0) return null;
|
||||||
const number = Number(connection.asn);
|
const number = Number(connection.asn);
|
||||||
return {
|
return {
|
||||||
address,
|
address,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
export const HARBOR_VERSIONS = Object.freeze({
|
export const HARBOR_VERSIONS = Object.freeze({
|
||||||
macClient: '0.25.0',
|
macClient: '0.25.1',
|
||||||
gatewayClient: '0.26.0',
|
gatewayClient: '0.26.0',
|
||||||
gatewayBackend: '0.26.0',
|
gatewayBackend: '0.26.1',
|
||||||
});
|
});
|
||||||
|
|
||||||
export interface ParsedVersion {
|
export interface ParsedVersion {
|
||||||
|
|||||||
@@ -253,7 +253,7 @@ test('a targeted network row reports provider, ASN and location through both for
|
|||||||
if (route === 'direct' && attempts.direct === 1) return response('{invalid');
|
if (route === 'direct' && attempts.direct === 1) return response('{invalid');
|
||||||
return response(JSON.stringify(route === 'vpn' ? {
|
return response(JSON.stringify(route === 'vpn' ? {
|
||||||
success: true,
|
success: true,
|
||||||
ip: '203.0.113.20',
|
ip: '2a12:bec4:1bb0:10bb::2',
|
||||||
city: 'Amsterdam',
|
city: 'Amsterdam',
|
||||||
country_code: 'NL',
|
country_code: 'NL',
|
||||||
connection: { asn: 9009, isp: 'M247 Europe' },
|
connection: { asn: 9009, isp: 'M247 Europe' },
|
||||||
@@ -278,6 +278,7 @@ test('a targeted network row reports provider, ASN and location through both for
|
|||||||
attempts: 3,
|
attempts: 3,
|
||||||
error: null,
|
error: null,
|
||||||
});
|
});
|
||||||
|
assert.equal(result.vpn.network.address, '2a12:bec4:1bb0:10bb::2');
|
||||||
assert.equal(result.vpn.network.asn, 'AS9009');
|
assert.equal(result.vpn.network.asn, 'AS9009');
|
||||||
assert.equal(result.vpn.network.provider, 'M247 Europe');
|
assert.equal(result.vpn.network.provider, 'M247 Europe');
|
||||||
assert.ok(calls.every((args) => args.at(-1) === 'https://ipwho.is/' && args.includes('--ipv4')));
|
assert.ok(calls.every((args) => args.at(-1) === 'https://ipwho.is/' && args.includes('--ipv4')));
|
||||||
|
|||||||
Reference in New Issue
Block a user