[wrangler] Validate header rules reject multiple wildcards - #12276
Conversation
🦋 Changeset detectedLatest commit: b844442 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Claude finished @penalosa's task —— View job Changeset ReviewReviewed changeset file: Todo List:
✅ All changesets look good The changeset properly:
The description clearly explains what was broken (silent runtime failures) and how this fix improves the user experience (early validation with clear error messages). |
0b27920 to
23ad0e2
Compare
Changeset ReviewFile:
|
| Criterion | Status | Notes |
|---|---|---|
| Version Type | ✅ | Patch is appropriate for this bug fix (was failing silently, now warns) |
| Changelog Quality | ✅ | Clear description of the change and previous behavior |
| Markdown Headers | ✅ | No h1/h2/h3 headers found |
| Analytics | ✅ | No analytics changes |
| Dependabot | ✅ | Not a dependency update |
| Experimental Features | ✅ | N/A - not an experimental feature change |
Summary
The changeset clearly describes:
- What is being warned about (headers rules with multiple wildcards or wildcard +
:splat) - Examples of problematic patterns
- The previous behavior (silent failure during dev)
✅ All changesets look good
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
commit: |
23ad0e2 to
1cdb079
Compare
|
Codeowners approval required for this PR:
Show detailed file reviewers
|
1cdb079 to
95859e1
Compare
95859e1 to
5c2585b
Compare
5c2585b to
4256c29
Compare
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
Codeowners approval required for this PR:
Show detailed file reviewers
|
petebacondarwin
left a comment
There was a problem hiding this comment.
Codeowners bypass
workers-devprod
left a comment
There was a problem hiding this comment.
Codeowners reviews satisfied
Fixes #9739.
This PR adds validation in
parseHeaders()to reject header rules that:https://*.pages.dev/*):splatplaceholder (e.g.,https://*.pages.dev/:splat)Previously, such rules were silently accepted during parsing but failed at runtime due to JavaScript regex duplicate named capture group errors. The rule would be quietly filtered out, causing unexpected behavior.
Also, previously when paths were invalid, we would confusingly throw the error message 'Path should come before header', because from the perspective of the parser, the invalid path wasn't there anymore and it was just a bare header.