[20.3.x] fix(http): skip TransferCache for cookie-bearing and credentialed requests by default#68941
Merged
Merged
Conversation
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.
JeanMeche
approved these changes
May 27, 2026
Contributor
Author
|
caretaker note please ignore mergeability check |
Member
|
This PR was merged into the repository. The changes were merged into the following branches:
|
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.
This PR backports the TransferCache credentials and cookie safety fixes to the
20.3.xbranch:fix(http): skip TransferCache for cookie-bearing requests by defaultfix(http): exclude withCredentials requests from transfer cacheTo compile correctly on
20.3.xwhere the modern transfer cache configurations are not yet present,CACHE_OPTIONSwas successfully exported intransfer_cache.ts. All test suites pass cleanly.