chore(extractor): set Referer to URL origin for external URLs

This commit is contained in:
WebStreamr 2025-06-15 20:41:02 +00:00
parent f192051328
commit 952993a537
No known key found for this signature in database

View file

@ -24,7 +24,7 @@ export class ExternalUrl extends Extractor {
protected async extractInternal(ctx: Context, url: URL, countryCode: CountryCode, title: string | undefined): Promise<UrlResult[]> {
try {
// Make sure the URL is accessible, but avoid causing noise and delays doing this
await this.fetcher.head(ctx, url, { noFlareSolverr: true, timeout: 1000 });
await this.fetcher.head(ctx, url, { noFlareSolverr: true, timeout: 1000, headers: { Referer: url.origin } });
} catch {
return [];
}