mirror of
https://github.com/SukkaW/Surge.git
synced 2025-12-13 17:50:34 +08:00
Fix: bail Firestore fetch out of HTTP cache
This commit is contained in:
parent
ff60e86a77
commit
0a00d8409a
@ -84,7 +84,7 @@ 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', {
|
const json = await (await fetch('https://firestore.googleapis.com/v1/projects/reserve-5a846/databases/(default)/documents/ipconfig/v3', {
|
||||||
headers: {
|
headers: {
|
||||||
Accept: '*/*',
|
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
|
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
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
import picocolors from 'picocolors';
|
import picocolors from 'picocolors';
|
||||||
import undici, {
|
import undici, {
|
||||||
interceptors,
|
interceptors,
|
||||||
Agent,
|
Agent
|
||||||
setGlobalDispatcher
|
// setGlobalDispatcher
|
||||||
} from 'undici';
|
} from 'undici';
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
@ -25,7 +25,7 @@ if (!fs.existsSync(CACHE_DIR)) {
|
|||||||
|
|
||||||
const agent = new Agent({ allowH2: true });
|
const agent = new Agent({ allowH2: true });
|
||||||
|
|
||||||
setGlobalDispatcher(agent.compose(
|
(agent.compose(
|
||||||
interceptors.dns({
|
interceptors.dns({
|
||||||
// disable IPv6
|
// disable IPv6
|
||||||
dualStack: false,
|
dualStack: false,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user