From 4ae1394febf5b325fc464ab46763f584be6c20b0 Mon Sep 17 00:00:00 2001 From: SukkaW Date: Sun, 10 Aug 2025 15:49:45 +0800 Subject: [PATCH] Fix: Telegram Backup IP fetching from Firebase Value Store --- Build/build-telegram-cidr.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Build/build-telegram-cidr.ts b/Build/build-telegram-cidr.ts index 4c028659..87e8c453 100644 --- a/Build/build-telegram-cidr.ts +++ b/Build/build-telegram-cidr.ts @@ -84,7 +84,14 @@ export const getTelegramCIDRPromise = once(async () => { // Backup IP Source 3: Firebase Value Store (test server not supported) try { - const json = await (await $$fetch('https://firestore.googleapis.com/v1/projects/reserve-5a846/databases/(default)/documents/ipconfig/v3')).json(); + const json = await (await $$fetch('https://firestore.googleapis.com/v1/projects/reserve-5a846/databases/(default)/documents/ipconfig/v3', { + headers: { + Accept: '*/*', + Origin: undefined // Without this line, Google API will return "Bad request: Origin doesn't match Host for XD3.". Probably have something to do with sqlite cache store + } + })).json(); + + // const json = await resp.json(); if ( json && typeof json === 'object' && 'fields' in json && typeof json.fields === 'object' && json.fields