Skip to content

Add CORS to the dynamic API endpoints - #67

Merged
RhysSullivan merged 1 commit into
mainfrom
api-cors
Aug 27, 2026
Merged

RhysSullivan merged 1 commit into
mainfrom
api-cors

Conversation

@RhysSullivan

Copy link
Copy Markdown
Collaborator

The static JSON routes (/api.json, /api/domains.json) are CORS-open, but the worker-served dynamic API (/api/search, /api/{domain}/detect|discover|surface, /openapi.json) was not — browser clients on other origins could not call it.

  • Adds access-control-allow-origin: * to all dynamic API responses (cached and passthrough paths).
  • Answers OPTIONS preflight with 204 + the usual allow headers.
  • Bumps CACHE_VERSION so previously edge-cached header-less responses are orphaned.

Needed by the executor console, whose connect dialog is gaining catalog search backed by /api/search and /api/{domain}/surface.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 27, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
integrationsdotsh 120ee9a Aug 27 2026, 06:28 AM

@RhysSullivan
RhysSullivan marked this pull request as ready for review August 27, 2026 07:23
@RhysSullivan
RhysSullivan merged commit 2ff7fa5 into main Aug 27, 2026
1 check passed
@RhysSullivan
RhysSullivan deleted the api-cors branch August 27, 2026 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant