Skip to content

Comments

Fixed invalid CORS wildcard example#28138

Merged
elithrar merged 1 commit intoproductionfrom
opencode/issue22002-20260206112442
Feb 9, 2026
Merged

Fixed invalid CORS wildcard example#28138
elithrar merged 1 commit intoproductionfrom
opencode/issue22002-20260206112442

Conversation

@ask-bonk
Copy link
Contributor

@ask-bonk ask-bonk bot commented Feb 6, 2026

No type checker available in CI, but the changes are syntactically straightforward JSX. The edit is correct.

Summary of changes:

The issue correctly identifies that the Workers CORS example used an invalid Access-Control-Allow-Origin value with a wildcard pattern (https://*-:worker.:subdomain.workers.dev/). Per the WHATWG Fetch spec, only *, null, or an exact origin are valid values.

What changed in src/content/partials/workers/custom_headers.mdx:

  • Removed the invalid Workers example that showed Access-Control-Allow-Origin: https://*-:worker.:subdomain.workers.dev/
  • Added a note for Workers users explaining the CORS spec limitation and directing them to handle dynamic preview URL origins in Worker code instead of _headers
  • Preserved the Pages example (Access-Control-Allow-Origin: https://staging.:project.pages.dev/) which is valid since it specifies an exact origin

Closes #22002

github run

Co-authored-by: elithrar <elithrar@users.noreply.github.com>
@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2026

This PR requires additional review attention because it affects the following areas:

Partials

This PR updates partial files, which are pieces of content used across multiple files in our Render component.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2026

This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:

Pattern Owners
/src/content/partials/workers/ @cloudflare/workers-docs, @GregBrimble, @irvinebroque, @mikenomitch, @WalshyDev, @cloudflare/deploy-config, @cloudflare/pcx-technical-writing, @cloudflare/wrangler, @mattietk

@elithrar elithrar enabled auto-merge (squash) February 6, 2026 11:29
@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2026

Copy link
Member

@MattieTK MattieTK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hate cors, love this change

@elithrar elithrar merged commit a0846be into production Feb 9, 2026
12 checks passed
@elithrar elithrar deleted the opencode/issue22002-20260206112442 branch February 9, 2026 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Invalid Access-Control-Allow-Origin example in Workers _headers docs

6 participants