Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[20.3.x] fix(http): skip TransferCache for cookie-bearing and credentialed requests by default#68941

Merged
alxhub merged 2 commits into
angular:20.3.xangular/angular:20.3.xfrom
alan-agius4:cherry-pick-67964-to-20.3.xalan-agius4/angular:cherry-pick-67964-to-20.3.xCopy head branch name to clipboard
May 27, 2026
Merged

[20.3.x] fix(http): skip TransferCache for cookie-bearing and credentialed requests by default#68941
alxhub merged 2 commits into
angular:20.3.xangular/angular:20.3.xfrom
alan-agius4:cherry-pick-67964-to-20.3.xalan-agius4/angular:cherry-pick-67964-to-20.3.xCopy head branch name to clipboard

Conversation

@alan-agius4

Copy link
Copy Markdown
Contributor

This PR backports the TransferCache credentials and cookie safety fixes to the 20.3.x branch:

To compile correctly on 20.3.x where the modern transfer cache configurations are not yet present, CACHE_OPTIONS was successfully exported in transfer_cache.ts. All test suites pass cleanly.

Yenya030 added 2 commits May 27, 2026 07:28
Treat requests with a Cookie header like other auth-bearing requests and skip TransferCache caching them by default.

This preserves the explicit opt-in path via includeRequestsWithAuthHeaders, adds regression coverage for cookie-bearing requests, and updates the SSR guide to document the behavior.
Update the transfer cache check to safely exclude all requests sent with the `withCredentials` flag.

By default, the HTTP transfer cache avoids caching user-specific responses to prevent sensitive data exposure or incorrect caching. While requests with explicit headers like `Cookie` or `Authorization` are excluded by default, requests can also be sent with credentials via the `withCredentials` flag without having those headers explicitly declared on the request object.

To keep user-specific responses from being cached, exclude `withCredentials` requests unconditionally, even when the `includeRequestsWithAuthHeaders` option is set to true.
@pullapprove pullapprove Bot requested a review from AndrewKushnir May 27, 2026 07:29
@angular-robot angular-robot Bot added the area: common/http Issues related to HTTP and HTTP Client label May 27, 2026
@ngbot ngbot Bot added this to the Backlog milestone May 27, 2026
@alan-agius4 alan-agius4 requested review from JeanMeche and removed request for AndrewKushnir May 27, 2026 07:32
@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker target: lts This PR is targeting a version currently in long-term support labels May 27, 2026
@alan-agius4 alan-agius4 added the merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note label May 27, 2026
@alan-agius4

Copy link
Copy Markdown
Contributor Author

caretaker note please ignore mergeability check

@alxhub alxhub merged commit de7b2a6 into angular:20.3.x May 27, 2026
30 of 36 checks passed
@alxhub

alxhub commented May 27, 2026

Copy link
Copy Markdown
Member

This PR was merged into the repository. The changes were merged into the following branches:

@angular-automatic-lock-bot

Copy link
Copy Markdown

This pull request has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot Bot locked and limited conversation to collaborators Jun 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: common/http Issues related to HTTP and HTTP Client merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note target: lts This PR is targeting a version currently in long-term support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.