fix lookup

This commit is contained in:
2026-03-07 00:39:06 +01:00
parent 56ed5909c7
commit 2f16721a93
3 changed files with 52 additions and 14 deletions
+5 -1
View File
@@ -13,11 +13,15 @@ export const GeoService = {
if (cached) return cached;
try {
const controller = new AbortController();
const timeout = setTimeout(() => controller.abort(), 5000);
const res = await fetch(`https://ip.albert.lol/${ip}`, {
method: 'GET',
cache: 'force-cache',
credentials: 'omit'
credentials: 'omit',
signal: controller.signal,
});
clearTimeout(timeout);
if (!res.ok) throw new Error(`API Error ${res.status}`);