Skip to content
代码片段 群组 项目
未验证 提交 b8261dfe 编辑于 作者: Josh Dadak's avatar Josh Dadak 提交者: GitHub
浏览文件

Return null in getCacheToUseIfEnabled when the protocol is not https (#24012)

Addresses #23082 
If served over http the cache is assumed compromised, this can happen when the page first loads over http before the https redirect.
上级 cf77999a
No related branches found
No related tags found
无相关合并请求
文件被 .gitattributes 条目压制或文件的编码不受支持。
...@@ -165,6 +165,12 @@ async function getCacheToUseIfEnabled(bootConfig: BootJsonData): Promise<Cache | ...@@ -165,6 +165,12 @@ async function getCacheToUseIfEnabled(bootConfig: BootJsonData): Promise<Cache |
return null; return null;
} }
// cache integrity is compromised if the first request has been served over http
// in this case, we want to disable caching and integrity validation
if (document.location.protocol !== 'https:') {
return null;
}
// Define a separate cache for each base href, so we're isolated from any other // Define a separate cache for each base href, so we're isolated from any other
// Blazor application running on the same origin. We need this so that we're free // Blazor application running on the same origin. We need this so that we're free
// to purge from the cache anything we're not using and don't let it keep growing, // to purge from the cache anything we're not using and don't let it keep growing,
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册