mirror of
https://github.com/cloudflare/vinext.git
synced 2026-09-14 19:04:59 +08:00
3d8aed9868
* fix(config): respect has/missing conditions in next.config headers Adds has/missing condition support to matchHeaders, wires request context through dev/prod paths, updates NextHeader types, and adds unit + e2e tests for header/cookie/query conditions. * chore: add backward-compat comment for optional ctx in matchHeaders Addresses review feedback: clarify that when no request context is passed, has/missing conditions are silently skipped for backward compatibility with existing callers. * fix: wire has/missing conditions through redirects and rewrites in Pages Router dev Pages Router dev was the only path missing has/missing support for redirects and rewrites. The reqCtx was already being built for headers, so hoist it and pass it to applyRedirects and applyRewrites too. Also refactors applyRedirects and applyRewrites to delegate to the shared matchRedirect/matchRewrite functions, eliminating duplicated pattern-matching logic (same dedup pattern used for applyHeaders). --------- Co-authored-by: tomoconstrutor <tomoconstrutor@gmail.com> Co-authored-by: Steve Faulkner <sfaulkner@cloudflare.com>