fix(@angular/ssr): use createRedirectResponse for i18n base-path redirects#32815
Open
artahir-dev wants to merge 1 commit intoangular:mainfrom
Open
fix(@angular/ssr): use createRedirectResponse for i18n base-path redirects#32815artahir-dev wants to merge 1 commit intoangular:mainfrom
artahir-dev wants to merge 1 commit intoangular:mainfrom
Conversation
…anguage redirects
There was a problem hiding this comment.
Code Review
This pull request refactors the i18n base-path redirect logic to use the shared createRedirectResponse helper. This change correctly incorporates the X-Forwarded-Prefix into the redirect Location and adds it to the Vary header, ensuring consistent behavior with other redirects in the SSR engine. The accompanying test changes validate this new behavior, including an updated test for the Vary header and a new test for prefixed redirects. The implementation appears correct and addresses the described issue.
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.
PR Checklist
Please check to confirm your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
The Accept-Language redirect path in
AngularAppEngineconstructs a redirect response directly instead of using the shared redirect helper. As a result, that path does not include forwarded prefix context inLocation, and theVaryheader omitsX-Forwarded-Prefix.Issue Number: N/A
What is the new behavior?
The locale redirect path now uses
createRedirectResponse, matching the rest of SSR redirect handling. Redirect responses now:LocationwithX-Forwarded-Prefixwhen present.Vary: X-Forwarded-Prefix, Accept-Language.Regression tests were added to verify both header semantics and prefixed redirect behavior.
Does this PR introduce a breaking change?
Other information
This PR is intentionally scoped to the Accept-Language base-path redirect flow.