Skip to content

Browser Redirect Support#78

Merged
CalebGerman merged 7 commits intomainfrom
cg/browser-redirect-support
Feb 12, 2026
Merged

Browser Redirect Support#78
CalebGerman merged 7 commits intomainfrom
cg/browser-redirect-support

Conversation

@CalebGerman
Copy link
Collaborator

@CalebGerman CalebGerman commented Feb 10, 2026

Initially built and tested this in a node enviroment for redirect. We did not support browser environments.

Redirect handling in Node vs browser

In Node (node-fetch), redirect: "manual" still exposes status and headers, so we can read Location and enforce our redirect policy. In browsers, the same setting yields opaqueredirect, which hides status/headers/body, so we can’t evaluate the redirect.

Using base fetch with default follow does not let us enforce our security measures before the redirect happens (Bentley-only domains, HTTPS-only, hop limits). In Node we can still do that with manual redirects; in browsers we can only validate the final URL after follow completes.

Solution

Now we have support for both while mataining more robust security in the node enviroment that we can not get with base fetch in browser enviroment.

Added playwrite tests to confrom browser enviroment is working.

#77

@CalebGerman CalebGerman requested a review from wsm95 February 10, 2026 19:12
Copy link
Collaborator

@wsm95 wsm95 left a comment

Choose a reason for hiding this comment

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

lgtm

@CalebGerman CalebGerman merged commit b93e76a into main Feb 12, 2026
2 checks passed
@CalebGerman CalebGerman deleted the cg/browser-redirect-support branch February 12, 2026 15:35
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.

2 participants