fix(@angular/ssr): preserve response headers during redirect#33476
fix(@angular/ssr): preserve response headers during redirect#33476alan-agius4 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the Angular SSR application to pass headers from responseInit to the redirect response, and adds corresponding tests to verify custom redirect headers. A review comment suggests avoiding Object.fromEntries because it can lose duplicate headers (such as multiple Set-Cookie headers), recommending instead to cast and pass responseInit.headers directly.
a4f3fd7 to
299ab00
Compare
This comment was marked as resolved.
This comment was marked as resolved.
There was a problem hiding this comment.
Code Review
This pull request updates the Angular SSR redirect logic to support and pass Headers objects from responseInit.headers during redirects, accompanied by test coverage. Feedback suggests reverting the check that avoids cloning Headers instances, as natively cloning them via new Headers(headers) prevents potential side effects from mutating shared header objects.
Previously, when a redirect was triggered, any custom headers (such as cookies or cache control) configured on the RESPONSE_INIT object by components or guards were lost because the redirect response was created with the default headers only. Closes angular#33473
Previously, when a redirect was triggered, any custom headers (such as cookies or cache control) configured on the RESPONSE_INIT object by components or guards were lost because the redirect response was created with the default headers only.
Closes #33473