Skip to content

fix(runtime): give incoming requests redirect manual, as workerd does - #79

Merged
eersnington merged 1 commit into
mainfrom
fix/incoming-request-redirect-manual
Nov 25, 2026
Merged

eersnington merged 1 commit into
mainfrom
fix/incoming-request-redirect-manual

Conversation

@eersnington

Copy link
Copy Markdown
Member

Gives every request Orange hands to a fetch() handler redirect: "manual", as workerd does. A proxy Worker that runs fetch(request) now gets a 3xx back as it is, so the client follows it. Before, Orange followed it on the server.

orange dev Before After, and on wrangler dev
request.redirect "follow" "manual"
fetch(new Request(url, request)) to a 302 200, location and set-cookie lost 302 with location and set-cookie
A redirect loop 500 Too many redirects. 302
  • Covers an HTTP request, a WebSocket upgrade, a Durable Object's fetch(), and a service binding callee, in-process and across sessions. workerd builds all of them in one place (global-scope.c++#L355).
  • A Worker that asks for redirect: "follow" still follows. Only the default of the request it receives changes.

Proof: pnpm test:e2e tests/events/incoming-redirect.test.ts passes 2/2. Before the change, /pass answers 200.

Fixes #47

A Worker, a Durable Object, and a service binding callee now get their request with redirect "manual". A Worker that passes its request on to fetch() gets a 3xx back as it is, with its location and cookies, instead of following it on the server.

Fixes #47
@eersnington
eersnington merged commit 8bc70d7 into main Nov 25, 2026
12 checks passed
@eersnington
eersnington deleted the fix/incoming-request-redirect-manual branch November 25, 2026 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

An incoming request has redirect "follow" under orange dev and orange serve

1 participant