localhost failsafe

This commit is contained in:
2026-03-07 00:53:57 +01:00
parent b3b76366bf
commit 7048baebc2
+3
View File
@@ -1,5 +1,8 @@
export const DnsService = { export const DnsService = {
async resolve(hostname: string): Promise<string | null> { async resolve(hostname: string): Promise<string | null> {
if (hostname === 'localhost' || hostname.endsWith('.local')) {
return '127.0.0.1';
}
try { try {
const controller = new AbortController(); const controller = new AbortController();
const timeout = setTimeout(() => controller.abort(), 5000); const timeout = setTimeout(() => controller.abort(), 5000);