Skip to content

fix: support redirect-to header to resolve Envoy proxy rejection (#2833) - #2834

Open
rajat12826 wants to merge 1 commit into
supabase:masterfrom
rajat12826:fix-redirect-to-envoy
Open

rajat12826 wants to merge 1 commit into
supabase:masterfrom
rajat12826:fix-redirect-to-envoy

Conversation

@rajat12826

Copy link
Copy Markdown

What kind of change does this PR introduce?

  • Bug fix

What is the current behavior?

Envoy proxy has a security-hardening configuration (headers_with_underscores_action: REJECT_REQUEST) that rejects HTTP headers containing underscores. Because GoTrue relied on the redirect_to HTTP header, requests routing through self-hosted Envoy proxies (like the ones configured via Supabase Docker deployments) were rejected as bad requests, breaking authentication redirect flows.

Resolves #2833

What is the new behavior?

This PR introduces support for the redirect-to header (without underscores) while safely falling back to the legacy redirect_to header for backward compatibility. This applies to both HTTP headers and form/query parameters.

  • Modified getRedirectTo in internal/utilities/request.go to extract redirect-to and fallback to redirect_to
  • Added relevant sub-tests in TestGetReferrer inside internal/utilities/request_test.go to explicitly test and verify both variants of the header

Additional context

This follows Envoy's standard recommendation that non-standard HTTP headers should utilize hyphens instead of underscores to pass through proxies correctly. All existing tests pass and the solution ensures no existing API usage breaks.

@rajat12826
rajat12826 requested a review from a team as a code owner September 25, 2026 14:21

This branch has not been deployed

No deployments
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.

Supabase's envoy disallows headers with underscores utilized by auth's redirect_to header

1 participant