Skip to content

[Workers] Request redirect mode: only follow and manual are supported - #33362

Open
stayinalive181 wants to merge 1 commit into
cloudflare:productionfrom
stayinalive181:workers-request-redirect-modes
Open

[Workers] Request redirect mode: only follow and manual are supported#33362
stayinalive181 wants to merge 1 commit into
cloudflare:productionfrom
stayinalive181:workers-request-redirect-modes

Conversation

@stayinalive181

Copy link
Copy Markdown

Summary

Correction to the Workers Request runtime API page (src/content/docs/workers/runtime-apis/request.mdx).

The page currently lists error as a valid redirect mode in two places: the redirect option of RequestInit and the read-only redirect property. Workers does not implement that mode. workerd rejects it while parsing the RequestInit dictionary, in src/workerd/api/http.c++:

TypeError: Invalid redirect value, must be one of "follow" or "manual" ("error" won't be implemented since it does not make sense at the edge; use "manual" and check the response status code).

Because the exception is thrown when the Request is constructed, fetch(url, { redirect: "error" }) fails before any request is sent, for every URL. Reproduced with wrangler dev and on deployed Workers; the identical failure for all destinations makes it look like a network problem, which is how we lost a day to it before finding the message above.

Both descriptions now say follow or manual, and explain that error throws a TypeError at construction and that manual plus a status-code check is the equivalent. A stray double space on the first line was removed at the same time.

Documentation checklist

  • The change adheres to the documentation style guide.
  • No changelog entry: this corrects the description of existing behaviour rather than announcing a change.
  • No files were renamed or moved, so no redirects are needed.

The Request page listed `error` as a valid redirect mode in both the
RequestInit option and the read-only property. workerd rejects it at
Request construction with a TypeError ("Invalid redirect value, must be
one of "follow" or "manual" ("error" won't be implemented since it does not
make sense at the edge; use "manual" and check the response status
code)."), so a Worker that passes it never sends the request. Document the
two supported values and the behaviour of `error`.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@cloudflare-docs-bot

cloudflare-docs-bot Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Review

✅ No issues found in commit a971374.

Code Review

This code review is in beta and may not always be helpful — use your judgment.

No code review issues found.

Conventions

No convention issues found.

Style Guide Review

No style-guide issues found.

Commands

Only codeowners can run commands. Post a comment with the command to trigger it.

Command Description
/review Runs a review now. Incremental if a prior review exists, full if not.
/full-review Re-reviews the entire PR diff from scratch, ignoring incremental history. Useful after a rebase, when you want a fresh review, or if the bot gets out of sync and reports issues that no longer exist.
/ignore-review-limit Permanently lifts the 2-review automatic limit for this PR. Future pushes will trigger reviews as normal.
/disable-auto-review Stops automatic reviews from triggering on future pushes to this PR. Codeowners can still run /review or /full-review manually.
/rebase Rebases the PR branch against production. On conflict, attempts to resolve automatically using AI. Stops with an explanation if confidence is not high enough.

@irvinebroque

Copy link
Copy Markdown
Contributor

@stayinalive181 i am curious what you were building / what you were trying to make work when you ran into this

@irvinebroque irvinebroque left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jasnell for review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product:workers Related to Workers product size/xs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants