From 5236fdbc40514023870b002b4c5f0dc369983310 Mon Sep 17 00:00:00 2001 From: Chris Taylor Date: Mon, 19 Oct 2026 23:32:48 +0100 Subject: [PATCH] Cloudflare Worker: drop SITE_KEY injection and ORIGIN_URL from the install The worker no longer rewrites HTML or takes an origin URL, so the guide was telling customers to configure two things that no longer exist and to build a DNS topology they no longer need. - The "Deployment modes" section is gone. There is one install: add the two script tags to your own pages. Auto-inject, HTMLRewriter and SITE_KEY are removed from the product, so the page says so once and moves on. - ORIGIN_URL and the second grey-clouded origin. record are gone. Allowed requests leave the worker with fetch(request), which on a route goes to the origin named by the hostname's own DNS record. One hostname, nothing to configure, no loop to avoid. A new section explains it. - The wrangler.toml example is now the whole file: PROTECT_URL plus [secrets] required = ["CLIENT_JWT"]. Documents that the shipped PROTECT_URL placeholder is deliberately not a URL (the worker logs an error and passes traffic through until it is replaced), and that deploy refuses to run until CLIENT_JWT is set. - The verify commands ran against workers.dev. That cannot work any more: a workers.dev URL has no origin behind it, so an allowed request re-enters the worker and Cloudflare returns Error 1042. They now run against the route. - "Excluding static assets" described the [assets] binding and run_worker_first, both removed. Which paths are checked now comes only from the protected-path list in the portal, refreshed every 60s with no redeploy. Added to the portal settings checklist. - Notes the bundle tag carries no integrity attribute on purpose, and moves the CSP note out of the deleted auto-inject section. - worker.js is ~105 KB now, not ~60 KB. Verified: astro build passes, 417 pages. The rendered page has no reference to auto-inject, HTMLRewriter, run_worker_first or two hostnames; the only SITE_KEY and ORIGIN_URL mentions are the two "this was removed" notes. --- .../en/protect-edge/cloudflare-worker.mdx | 140 +++++++----------- 1 file changed, 54 insertions(+), 86 deletions(-) diff --git a/src/content/docs/en/protect-edge/cloudflare-worker.mdx b/src/content/docs/en/protect-edge/cloudflare-worker.mdx index 237408b517553..3b0b6d2564e7c 100644 --- a/src/content/docs/en/protect-edge/cloudflare-worker.mdx +++ b/src/content/docs/en/protect-edge/cloudflare-worker.mdx @@ -13,7 +13,7 @@ A production Prosopo Protect integration is two independent pieces working toget - **Part 1: the Cloudflare Worker (server-side).** Sits in front of your origin, runs the verdict on every request, and blocks bad traffic before it reaches your server. This is `worker.js` plus `wrangler.toml`. - **Part 2: the Protect JS bundle (client-side).** Loaded on every HTML page users visit. Creates the session cookie, collects the bot-signal telemetry the risk engine scores, and shows the captcha overlay when the worker returns a challenge. This is a single ` - -``` - -The rewriter is streaming so there's no measurable latency cost. Non-HTML responses (JSON, CSS, images, XHR replies) pass through untouched. - -**CSP note.** If your site sets a `Content-Security-Policy` header, add `https://js.protect.prosopo.io` to `script-src` so the injected `