mirror of
https://github.com/SukkaW/Surge.git
synced 2025-12-12 01:00:34 +08:00
Fix: Telegram Backup IP fetching from Firebase Value Store
This commit is contained in:
parent
93cc82d897
commit
4ae1394feb
@ -84,7 +84,14 @@ export const getTelegramCIDRPromise = once(async () => {
|
|||||||
|
|
||||||
// Backup IP Source 3: Firebase Value Store (test server not supported)
|
// Backup IP Source 3: Firebase Value Store (test server not supported)
|
||||||
try {
|
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 (
|
if (
|
||||||
json && typeof json === 'object'
|
json && typeof json === 'object'
|
||||||
&& 'fields' in json && typeof json.fields === 'object' && json.fields
|
&& 'fields' in json && typeof json.fields === 'object' && json.fields
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user