On November 28, 2026, Cloudflare added support for redirect: "error" in fetch() and Request on Workers. The runtime now covers all three redirect modes in the WHATWG Fetch Standard: follow, manual and error. The mode is on by default for Workers with a compatibility date (the date that pins runtime behavior for that Worker) of 2026-12-22 or later. On earlier dates, you need the fetch_redirect_error flag.
What error mode does in fetch
With redirect: "error", fetch() sends the request as usual. If the response is a redirect (301, 302, 303, 307 or 308), the promise rejects with a TypeError and the Worker does not contact the destination. It rejects even when the response has no Location header. Other 3xx codes, such as 304 Not Modified, reach your code normally.
The other two modes stay the same. Passing a URL to fetch() still defaults to follow, and the incoming Request in the fetch handler still uses manual, so fetch(request) returns the origin's redirect response without following it.
Without the flag, the behavior is different: constructing a Request with redirect: "error" throws a TypeError immediately, and fetch(url, { redirect: "error" }) rejects before sending anything. On dates from 2026-12-22 onward, the no_fetch_redirect_error flag turns the mode off.
Who uses Workers to call other services
Cloudflare points to three situations:
- calls that carry secrets in headers (
Authorization,Cookie,X-API-Key) and OAuth token exchanges, so a redirect cannot forward those headers to another destination; - fetching user-supplied URLs, such as webhooks, link previews and feed readers: after you validate the address, the mode stops a redirect from taking the request to a host that was never validated, a common SSRF path (when a server is tricked into making requests to internal or unauthorized addresses);
- APIs that should never redirect. If a third-party service sends the request to an HTML sign-in page, the error shows up right away, instead of spending subrequests following the redirect and failing later while parsing the response.
Code that runs in both the browser and the Worker also benefits: browsers already accepted error, and manual behaves differently in the two places. In the browser it returns an opaqueredirect response with status 0 and no headers; in a Worker it returns the real status and headers.
Workers that only serve content, without outbound fetch() calls carrying credentials or external URLs, have nothing to change.
What to check before raising the compatibility date
There is no mandatory deadline. The December 22 date only applies to Workers whose compatibility date is moved to it or later. Until then, anyone who wants the mode adds the flag:
compatibility_flags = ["fetch_redirect_error"]Things to review:
- search for
redirect: "error"in your code and dependencies. Today that value makesfetch()fail before sending the request. With the flag or the new date, the request goes out. Acatchthat treated that failure as a fallback path will stop firing; - in Workers that talk over RPC or service bindings, a
Requestwithredirect: "error"throws aTypeErrorwhen it reaches a Worker without the flag. Compatibility dates or flags on both sides need to move together; - for calls carrying API keys or tokens, decide whether a redirect should be followed. If not, switch from the default
followtoerrorand handle theTypeErroras an integration failure; - where the Worker needs to see where the server wants to send the request, for example to check the new host against an allowlist,
manualis still the option.
What is still unknown
The changelog and documentation do not state the minimum Wrangler or workerd version that accepts the flag in local development. They also do not say whether Cloudflare will ever change the default from follow to error. For now, code that does not pass the option explicitly keeps following redirects.
If your company is weighing something similar or needs support on this topic, reach me on LinkedIn or WhatsApp.