fix(@angular/ssr): use createRedirectResponse for i18n base-path redirects#32815
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.
…ccept-language redirects
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
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.