Fix DNS TTL

This commit is contained in:
Younes Aassila 2024-03-08 22:03:59 +01:00
parent 80625abfd9
commit aaee925d20

View File

@ -55,9 +55,11 @@ export default async function updateDnsResponses() {
console.error("Answer is not an array:", Answer); console.error("Answer is not an array:", Answer);
continue; continue;
} }
const ips = Answer.map((answer: any) => answer.data); const ips = Answer.map((answer: any) => answer.data as string);
const ttl = const ttl = Math.max(
Number(response.headers.get("Cache-Control")?.split("=")[1]) || 0; Math.max(...Answer.map((answer: any) => answer.TTL as number)),
300
);
if (dnsResponseIndex !== -1) { if (dnsResponseIndex !== -1) {
store.state.dnsResponses.splice(dnsResponseIndex, 1); store.state.dnsResponses.splice(dnsResponseIndex, 1);
} }