chore: do not use proxy for MFP urls

This commit is contained in:
WebStreamr 2025-11-28 16:06:29 +00:00
parent e1c727b7de
commit 280abc4dea
No known key found for this signature in database

View file

@ -104,7 +104,7 @@ export class Fetcher {
}
protected async fetchWithTimeout(ctx: Context, url: URL, requestConfig?: CustomRequestConfig, tryCount = 0): Promise<AxiosResponse> {
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) {