| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Treat HttpClient requests using `credentials: 'include'` and `same-origin` as credentialed when deciding whether a response can be stored in the HTTP transfer cache. The transfer cache already skips requests with `withCredentials`, `Cookie`, `Authorization`, or `Proxy-Authorization` because those responses may contain user-specific data. Fetch-backed requests can express the same credentialed behavior through the `credentials` option, so these responses must not be serialized into the SSR HTML. This keeps credentialed SSR responses out of TransferState and aligns the cache eligibility check with the fetch request options supported by HttpClient.
Do not store HTTP transfer cache entries when either the request or response uses `Cache-Control: no-store`, `Cache-Control: private`, or `Cache-Control: no-cache`. Also skip transfer cache when requests use the Fetch API `cache` option with `no-store` or `no-cache`. Because transfer cache serializes SSR HTTP responses into the rendered HTML, Angular now treats these directives conservatively to avoid exposing sensitive or explicitly uncacheable data through `TransferState`.
| } | ||
|
|
||
| return cacheControl.split(',').some((directive) => { | ||
| const directiveName = directive.trim().split('=', 1)[0].trim().toLowerCase(); |
There was a problem hiding this comment.
The first trim is redundant.
| const directiveName = directive.trim().split('=', 1)[0].trim().toLowerCase(); | |
| const directiveName = directive..split('=', 1)[0].trim().toLowerCase(); |
Sorry, something went wrong.
There was a problem hiding this comment.
Done
Sorry, something went wrong.
|
@JeanMeche I think the PR would be ready to merge? That way I could also generate the corresponding backports. |
Sorry, something went wrong.
|
This PR was merged into the repository. The changes were merged into the following branches:
|
Sorry, something went wrong.
Do not store HTTP transfer cache entries when either the request or response uses `Cache-Control: no-store`, `Cache-Control: private`, or `Cache-Control: no-cache`. Also skip transfer cache when requests use the Fetch API `cache` option with `no-store` or `no-cache`. Because transfer cache serializes SSR HTTP responses into the rendered HTML, Angular now treats these directives conservatively to avoid exposing sensitive or explicitly uncacheable data through `TransferState`. PR Close #69017
|
This pull request has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
fix(http): skip transfer cache for fetch credentialed requests
Treat HttpClient requests using credentials: 'include' and same-origin as credentialed when deciding whether a response can be stored in the HTTP transfer cache.
The transfer cache already skips requests with withCredentials, Cookie, Authorization, or Proxy-Authorization because those responses may contain user-specific data. Fetch-backed requests can express the same credentialed behavior through the credentials option, so these responses must not be serialized into the SSR HTML.
This keeps credentialed SSR responses out of TransferState and aligns the cache eligibility check with the fetch request options supported by HttpClient.
This can be considered a variant of #67964
fix(http): skip transfer cache for uncacheable HTTP traffic
Do not store HTTP transfer cache entries when either the request or response
uses Cache-Control: no-store, Cache-Control: private, or
Cache-Control: no-cache.
Also skip transfer cache when requests use the Fetch API cache option with
no-store or no-cache.
Because transfer cache serializes SSR HTTP responses into the rendered HTML,
Angular now treats these directives conservatively to avoid exposing sensitive
or explicitly uncacheable data through TransferState.