From 280abc4dea4c63dcbca778d333ad4cf267c2a079 Mon Sep 17 00:00:00 2001 From: WebStreamr <210764791+webstreamr@users.noreply.github.com> Date: Fri, 28 Nov 2025 16:06:29 +0000 Subject: [PATCH] chore: do not use proxy for MFP urls --- src/utils/Fetcher.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/utils/Fetcher.ts b/src/utils/Fetcher.ts index 7c3bdc9..0481b59 100644 --- a/src/utils/Fetcher.ts +++ b/src/utils/Fetcher.ts @@ -104,7 +104,7 @@ export class Fetcher { } protected async fetchWithTimeout(ctx: Context, url: URL, requestConfig?: CustomRequestConfig, tryCount = 0): Promise { - const proxyUrl = this.getProxyForUrl(url); + const proxyUrl = this.getProxyForUrl(ctx, url); let message = `Fetch ${requestConfig?.method ?? 'GET'} ${url}`; /* istanbul ignore if */ @@ -319,7 +319,11 @@ export class Fetcher { return new Promise(sleep => setTimeout(sleep, ms)); } - private getProxyForUrl(url: URL): URL | undefined { + private getProxyForUrl(ctx: Context, url: URL): URL | undefined { + if (ctx.config.mediaFlowProxyUrl && url.href.startsWith(ctx.config.mediaFlowProxyUrl)) { + return undefined; + } + const proxyConfig = process.env['PROXY_CONFIG']; if (proxyConfig) {