diff --git a/lib/middleware/parameter.test.ts b/lib/middleware/parameter.test.ts index 57debada33ca16..201f6f43dce4f4 100644 --- a/lib/middleware/parameter.test.ts +++ b/lib/middleware/parameter.test.ts @@ -3,6 +3,7 @@ import Parser from 'rss-parser'; process.env.OPENAI_API_KEY = 'sk-1234567890'; process.env.OPENAI_API_ENDPOINT = 'https://api.openai.mock/v1'; +process.env.ALLOW_CIDR = '127.0.0.1/32'; vi.mock('@/utils/request-rewriter', () => ({ default: null })); const { config } = await import('@/config'); diff --git a/lib/utils/got.test.ts b/lib/utils/got.test.ts index 0fc54147837137..92d66badaf4d8e 100644 --- a/lib/utils/got.test.ts +++ b/lib/utils/got.test.ts @@ -4,6 +4,8 @@ import got from '@/utils/got'; import { config } from '@/config'; import { Cookie, CookieJar } from 'tough-cookie'; +process.env.ALLOW_CIDR = '127.0.0.1/32'; + describe('got', () => { it('headers', async () => { const { data } = await got('http://rsshub.test/headers'); diff --git a/lib/utils/ofetch.test.ts b/lib/utils/ofetch.test.ts index 8815ad2adc641d..29dfeaffce0d8b 100644 --- a/lib/utils/ofetch.test.ts +++ b/lib/utils/ofetch.test.ts @@ -3,6 +3,8 @@ import { http, HttpResponse } from 'msw'; import ofetch from '@/utils/ofetch'; import { config } from '@/config'; +process.env.ALLOW_CIDR = '127.0.0.1/32'; + describe('ofetch', () => { it('headers', async () => { const data = await ofetch('http://rsshub.test/headers'); diff --git a/lib/utils/request-rewriter.test.ts b/lib/utils/request-rewriter.test.ts index e274128f354b28..82ca9e0a585134 100644 --- a/lib/utils/request-rewriter.test.ts +++ b/lib/utils/request-rewriter.test.ts @@ -6,6 +6,7 @@ import http from 'node:http'; process.env.PROXY_URI = 'http://rsshub.proxy:2333/'; process.env.PROXY_AUTH = 'rsshubtest'; process.env.PROXY_URL_REGEX = 'headers'; +process.env.ALLOW_CIDR = '127.0.0.1/32'; await import('@/utils/request-rewriter'); const { config } = await import('@/config');