Patch Changes
-
#13919
c7eab7fThanks @petebacondarwin! - Fix the outboundCF-Workerheader reflecting the route pattern hostname instead of the parent zone, and falling back to<worker-name>.example.comundervite dev,vitest-pool-workers, andgetPlatformProxyTwo related issues affected the
CF-Workerheader on outbound subrequests in local development:- Under
@cloudflare/vite-plugin,@cloudflare/vitest-pool-workers, andgetPlatformProxy, the header fell back to<worker-name>.example.comeven whenrouteswere configured, becauseunstable_getMiniflareWorkerOptionsand the equivalentgetPlatformProxyworker-options path did not propagate azonevalue to Miniflare. This broke local development against services that reject unknownCF-Workerhosts (for example, Apple WeatherKit returns403 Forbidden). - Across the above paths and
wrangler dev --local, when a route used thezone_namefield (for example{ pattern: "foo.example.com/*", zone_name: "example.com" }), the header was set to the pattern's hostname (foo.example.com) rather than the zone name (example.com). Production setsCF-Workerto the zone name that owns the Worker, so this was inconsistent with deployed behaviour.
Both bugs are fixed: the new
unstable_getMiniflareWorkerOptions/getPlatformProxypath now propagates azonederived from the first configured route, and all four local-dev paths now prefer a route's explicitzone_nameover the pattern hostname when computing that zone. Whenzone_nameisn't set, the existing best-effort behaviour is preserved — forwrangler devthis meansdev.hostis still honoured as a local override and the pattern hostname is used as a final fallback. Resolving the parent zone forzone_id-only,custom_domain, or plain-string routes would require an API lookup, so locally we still approximate it with the pattern hostname.Note:
dev.hostis intentionally not consulted by theunstable_getMiniflareWorkerOptions/getPlatformProxypaths — thedevconfig block is specific towrangler dev. - Under
-
Updated dependencies [
fa1f61f,2679e05,7e40d98,adc9221,735852d,d803737,c7eab7f,e04e180,59cd880,62abf97,e8c2031,e349fe0,da0fa8c,a5c9365]:- miniflare@4.20260520.0
- wrangler@4.93.1