[wrangler] Surface _redirects validation warnings at deploy time (#14694)#14709
[wrangler] Surface _redirects validation warnings at deploy time (#14694)#14709allocsys wants to merge 13 commits into
Conversation
🦋 Changeset detectedLatest commit: 16eb284 The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 packages
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 |
|
Codeowners approval required for this PR:
Show detailed file reviewers
|
…udflare#14694 review comment) config.assets?.html_handling was already available in this function but wasn't threaded through to the new deploy-time parseRedirects() call, so htmlHandling defaulted to undefined -- which parseRedirects treats as "enabled" -- causing false "infinite loop detected" warnings for users who set html_handling: "none" on rules like `/ /index.html`. Now passes the same option the Vite plugin already passes correctly.
…infinite-loop warning at deploy time Covers the review finding on cloudflare#14709 -- parseRedirects() previously ran with htmlHandling always undefined at deploy time (treated as enabled), so a rule like `/ /index.html` was flagged as an infinite loop even for projects that explicitly disabled HTML handling. Adds a test confirming no warning is produced now that config.assets?.html_handling is threaded through, plus a sanity check that the real infinite-loop case is still caught when HTML handling is left at its default.
|
Fixed in 018173c — Added two regression tests in 627a9d2:
Both commits are pushed to this PR's branch. Thanks for catching this! |
@cloudflare/autoconfig
@cloudflare/config
create-cloudflare
@cloudflare/deploy-helpers
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-auth
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
commit: |
NuroDev
left a comment
There was a problem hiding this comment.
Can you also update the PR description to reflect the repository template so we have details on tests, docs, etc.
… appears in the wrangler changelog, per Devin review feedback on PR cloudflare#14709
|
Good catch — fixed in 175cf65. |
|
@NuroDev The PR description now includes the Tests and Documentation sections from the template — could you take another look when you get a chance? |
|
Codeowners approval required for this PR:
Show detailed file reviewers
|
Fixes #14694
What this PR solves
Wrangler's deploy-time
_redirectsvalidation didn't respectassets.html_handlingwhen checking for infinite-loop redirect rules. This caused a false "infinite loop" warning for setups likehtml_handling: "none"with a rule such as/ /index.html, since the validator didn't account for HTML handling being disabled.Fix
parseRedirects()inresolveAssetOptions()now passeshtmlHandling: config.assets?.html_handling, matching the behavior already used by the Vite plugin (packages/vite-plugin-cloudflare/src/asset-config.ts).Tests
html_handling: "none"+ a rule like/ /index.htmlno longer produces a false "infinite loop" warning at deploy timeDocumentation