mirror of
https://github.com/Viren070/AIOStreams.git
synced 2025-12-01 23:14:04 +01:00
fix: ignore recursion checks for certain requests
This commit is contained in:
@@ -32,7 +32,8 @@ export function makeRequest(
|
||||
url: string,
|
||||
timeout: number,
|
||||
headers: HeadersInit = {},
|
||||
forwardIp?: string
|
||||
forwardIp?: string,
|
||||
ignoreRecursion?: boolean
|
||||
) {
|
||||
const useProxy = shouldProxy(url);
|
||||
headers = new Headers(headers);
|
||||
@@ -45,7 +46,7 @@ export function makeRequest(
|
||||
// block recursive requests
|
||||
const key = `${url}-${forwardIp}`;
|
||||
const currentCount = urlCount.get(key, false) ?? 0;
|
||||
if (currentCount > Env.RECURSION_THRESHOLD_LIMIT) {
|
||||
if (currentCount > Env.RECURSION_THRESHOLD_LIMIT && !ignoreRecursion) {
|
||||
logger.warn(
|
||||
`Detected possible recursive requests to ${url}. Current count: ${currentCount}. Blocking request.`
|
||||
);
|
||||
|
||||
@@ -20,7 +20,10 @@ export class RPDB {
|
||||
public async validateApiKey() {
|
||||
const response = await makeRequest(
|
||||
`https://api.ratingposterdb.com/${this.apiKey}/isValid`,
|
||||
5000
|
||||
5000,
|
||||
undefined,
|
||||
undefined,
|
||||
true
|
||||
);
|
||||
if (!response.ok) {
|
||||
throw new Error(
|
||||
|
||||
Reference in New Issue
Block a user