{
  "slug": "wrangler-dev-adds-infer-origin-from-routes-opt-out-53dd5c176ab4",
  "title": "wrangler dev adds --infer-origin-from-routes opt-out",
  "tools": [
    "wrangler"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-10-26T14:32:42.000Z",
  "announced_at": "2026-10-26T14:32:42.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When a Wrangler config has `routes` and local development must preserve the client's local origin, run `wrangler dev --infer-origin-from-routes=false`. The flag defaults to `true`; explicit `--host`, `--local-upstream`, or `dev.host` takes precedence.",
    "examples": [
      "wrangler dev --infer-origin-from-routes=false"
    ],
    "gotchas": [
      "Version: 4.153.0",
      "--infer-origin-from-routes: Boolean, default `true`. Uses the first configured route to infer the origin seen by the Worker in local mode; set to `false` to preserve the real local origin. Explicit `--host`, `--local-upstream`, or `dev.host` takes precedence.",
      "Prerequisite: Wrangler must be installed to run the command. Cloudflare recommends installing it locally in the project; the docs show `npx wrangler` as one way to run commands.",
      "The inference remains the default when a config has `routes`.",
      "An explicitly configured `--host`, `--local-upstream`, or `dev.host` continues to take precedence either way.",
      "The flag only affects local development; in remote mode the route host still determines the preview session."
    ]
  },
  "why_it_matters": "When debugging local requests whose Host or Origin handling depends on localhost, run the Worker with route-based origin inference disabled.",
  "before": "Use route-based origin inference, which rewrites `request.url`, the `Host` header, and any `Origin` header to the first route's host, potentially breaking Host/Origin-sensitive logic in local development.",
  "sources": [
    "https://github.com/cloudflare/workers-sdk/releases/tag/wrangler%404.153.0",
    "https://developers.cloudflare.com/workers/wrangler/commands/workers/",
    "https://developers.cloudflare.com/workers/wrangler/commands/"
  ],
  "rank": 0.95032,
  "review_state": "approved",
  "provenance": {
    "run_id": "daily-20261027-04",
    "verdict_id": "daily-20261027-04:daily-20261027-04-336141da1cf5c4df-0:gate",
    "evidence_hash": "63ea01483527eea653c6543401fd003fc0ea03c63aae82f263391b02cad64fb6"
  }
}
