Skip to content

Commit 3ba4106

Browse files
feat: update removing of adoption
1 parent 76702e8 commit 3ba4106

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/adoption-code/route/adoption-code.ts

+2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ const handle = async (ctx: Context): Promise<void> => {
3030
longitude: probe.location.longitude,
3131
asn: probe.location.asn,
3232
network: probe.location.network,
33+
isIPv4Supported: probe.isIPv4Supported,
34+
isIPv6Supported: probe.isIPv6Supported,
3335
};
3436
};
3537

src/lib/get-probe-ip.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ const getProbeIp = (socket: Socket) => {
1212

1313
// Use random ip assigned by the API
1414
if (process.env['FAKE_PROBE_IP']) {
15+
// Use fake ip provided by the probe if exists
16+
if (socket.handshake.query['fakeIp']) {
17+
return socket.handshake.query['fakeIp'] as string;
18+
}
19+
1520
const samples = [
1621
'131.255.7.26', // Buenos Aires
1722
'213.136.174.80', // Naples
@@ -30,11 +35,6 @@ const getProbeIp = (socket: Socket) => {
3035
return samples[index];
3136
}
3237

33-
// Use fake ip provided by the probe
34-
if (process.env['TEST_MODE'] === 'perf') {
35-
return socket.handshake.query['fakeIp'] as string;
36-
}
37-
3838
const clientIp = requestIp.getClientIp(socket.request);
3939

4040
if (!clientIp) {

0 commit comments

Comments
 (0)