fix(web): preserve workspace domains through redirects - #7442
Merged
Conversation
✅ Deploy Preview for anarlog canceled.
|
ComputelessComputer
changed the base branch from
fix/workspace-share-proxy-host
to
main
September 7, 2026 14:48
ComputelessComputer
force-pushed
the
fix/workspace-share-redirects
branch
from
September 7, 2026 15:02
8413450 to
5d27f42
Compare
Rewrite Netlify-origin redirect destinations to the workspace hostname while keeping external redirects and proxy credentials separate.
ComputelessComputer
force-pushed
the
fix/workspace-share-redirects
branch
from
September 7, 2026 15:02
5d27f42 to
186d065
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Netlify can return absolute redirect destinations using its origin hostname. Rewrite those destinations to the incoming workspace hostname so trailing-slash and auth redirects keep users on their workspace domain. Preserve external redirects and keep redirect following disabled so proxy credentials stay on the origin.
Validation: web typecheck, 317 web tests, formatting, and Wrangler dry-run passed. Tests cover absolute and relative origin redirects and an external auth destination. This only changes the Cloudflare Worker and its tests; the web application deployment is unchanged.
Note
Medium Risk
Changes redirect handling on the workspace proxy edge path; incorrect rewriting could break auth or trailing-slash flows, though scope is limited to the Cloudflare worker.
Overview
The Cloudflare workspace-share worker now rewrites redirect
Locationheaders from the Netlify origin so users stay on their workspace hostname (e.g.fastrepl.anarlog.so) instead of being sent toanarlog.netlify.app.After proxying to origin with
redirect: manual, 3xx responses are inspected: if the resolved URL’s origin matches the app origin, only the host is swapped to the incoming request’s host; query strings, fragments, and relative paths are preserved. External redirects (e.g. Google OAuth) are passed through unchanged.New tests cover absolute Netlify URLs, relative
/auth/paths, and an external auth URL.Reviewed by Cursor Bugbot for commit 186d065. Bugbot is set up for automated code reviews on this repo. Configure here.