Skip to content

Commit

Permalink
Update the DNS-leak check
Browse files Browse the repository at this point in the history
Update the way we check for DNS leaks to use a single HTTP request.
  • Loading branch information
gregoire-mullvad authored and ruihildt committed Nov 23, 2023
1 parent 0eaca6f commit ab7e708
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/composables/useCheckDnsLeaks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,13 @@ export type DnsServer = {
};

const DNSLEAK_URL = 'dnsleak.am.i.mullvad.net';
const CONNCHECK_URL = 'am.i.mullvad.net';

const dnsLeakRequest = async () => {
const uuid = uuidv4().replace(/-/g, '');
try {
await axios.get(`https://${uuid}.${DNSLEAK_URL}`, { timeout: 10000 });
} catch (_) {
// This request is intended to fail
}
const { data } = await axios.get<DnsServer[]>(`https://${CONNCHECK_URL}/dnsleak/${uuid}`, {
const uuid = uuidv4();
const { data } = await axios.get(`https://${uuid}.${DNSLEAK_URL}`, {
headers: { accept: 'application/json' },
timeout: 10000,
});

return data;
};

Expand Down

0 comments on commit ab7e708

Please sign in to comment.