Repository navigation
Conversation
The worker behind the default CORS proxy only ever existed in the Cloudflare dashboard. Version it under infra/cors-worker/ (same worker name, so wrangler deploys in place) with: - cache-header overrides + edge cache, so a dead image that answers 404 with no-cache is not re-fetched forever - SSRF guard (http(s) only, no private/loopback/link-local, redirects re-validated) - 25 MiB response cap - error-only logging, hostname only (never the full ?url=) - no upstream forwarding of cookies/authorization Adds node:test coverage and declares the Workers globals for eslint. Refs #78
✅ Deploy Preview for savrlist ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This was referenced Oct 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Brings the Cloudflare CORS proxy worker into the repo under
infra/cors-worker/and hardens it. It previously existed only in the Cloudflare dashboard (source: dash), so it was unversioned and unreviewable.wrangler.tomlkeeps the same worker name, sowrangler deployupdates it in place.Files:
worker.js— the worker (deployed as-is, no build step)wrangler.toml— name, entry, compatibility date, observability,preview_urls = falseworker.test.mjs—node --testcoverageREADME.md— origin, deploy, behaviour, and scope limitsHardening
Cache-Controlstraight through. A dead image answered404withcache-control: no-cache, so a retrying client re-fetched it ~24k times (the ~234k-request/day incident, Politely refetch: dedupe, negative-cache and back off repeated proxy requests #78). Now the worker overrides caching by status/content-type (images/fonts/css/js immutable for a year, HTML 5 min, 404max-age=3600, 5xx 60s) and stores responses incaches.default.http(s)only; loopback/private/link-local/CGNAT/reserved addresses refused; every redirect hop re-validated.> 25 MiB→413.?url=(can contain API keys). Also removes the old per-request logging.Accept/Accept-Language/Range.There is deliberately no host allowlist — it must serve arbitrary public sites.
Testing
node --test infra/cors-worker/→ 10 passed (preflight, missing/invalid URL, SSRF cases, redirect-to-private, cache-header override + edge cache, immutable images, cache-hit short-circuit, size cap, secret-never-logged).jest→ 327 passed;tsc --noEmitandeslintclean.Deployed
Already deployed to
lively-cors-proxy-b569(version16cbbbd1) and verified live: preflight OK, imageimmutable,127.0.0.1/169.254.169.254→403, missing path →404withcache-control: max-age=3600.Refs #78.