snapshot: make web hosted images bypass hotlink protection

This commit is contained in:
Koushik Dutta
2025-12-27 19:27:30 -08:00
parent 63a88e727a
commit 5d02217a3e

View File

@@ -769,6 +769,9 @@ export class SnapshotPlugin extends AutoenableMixinProvider implements MixinProv
}
let pathname = request.url.substring(request.rootPath.length);
// hotlink-ok is used by cloudflare to indicate that hotlink protection should be bypassed.
// https://developers.cloudflare.com/waf/tools/scrape-shield/hotlink-protection/
if (pathname.startsWith('/hotlink-ok'))
pathname = pathname.substring('/hotlink-ok'.length);