Skip to content

fix(supabase): drop the apikey on a cross-origin redirect - #2204

Merged
spydon merged 2 commits into
mainfrom
lukasklingsbo/sdk-3187-drop-apikey-on-cross-origin-redirect
Nov 30, 2026
Merged

spydon merged 2 commits into
mainfrom
lukasklingsbo/sdk-3187-drop-apikey-on-cross-origin-redirect

Conversation

@spydon

@spydon spydon commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

dart:io keeps custom headers when it follows a redirect, so the apikey (often a secret key) reached any host a Supabase endpoint redirected to.

  • SupabaseClient now follows redirects one hop at a time on native, dropping apikey, Authorization and cookies when the scheme, host or port changes.
  • The redirect loop moved out of TracePropagationClient into a shared CrossOriginRedirectClient, which the trace client reuses for its trace header rule.
  • Web is unchanged, as the browser follows redirects itself.

Closes SDK-3187

@coderabbitai

coderabbitai Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 14 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between ccbc494 and db658d6.

Files selected for processing: 5

  • packages/supabase/lib/src/redirect_http_client.dart
  • packages/supabase/lib/src/supabase_client.dart
  • packages/supabase/lib/src/trace_http_client.dart
  • packages/supabase/test/redirect_http_client_test.dart
  • packages/supabase/test/trace_propagation_test.dart
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@spydon
spydon force-pushed the lukasklingsbo/sdk-3187-drop-apikey-on-cross-origin-redirect branch from 819942b to d583878 Compare November 30, 2026 10:52
@spydon
spydon merged commit df9f06b into main Nov 30, 2026
55 checks passed
@spydon
spydon deleted the lukasklingsbo/sdk-3187-drop-apikey-on-cross-origin-redirect branch November 30, 2026 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant