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);
continue;
}
const ips = Answer.map((answer: any) => answer.data);
const ttl =
Number(response.headers.get("Cache-Control")?.split("=")[1]) || 0;
const ips = Answer.map((answer: any) => answer.data as string);
const ttl = Math.max(
Math.max(...Answer.map((answer: any) => answer.TTL as number)),
300
);
if (dnsResponseIndex !== -1) {
store.state.dnsResponses.splice(dnsResponseIndex, 1);
}