mirror of
https://github.com/skidoodle/hostinfo
synced 2026-04-29 01:57:36 +02:00
fix lookup
This commit is contained in:
+5
-1
@@ -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}`);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user