Skip to content

Commit 755949b

Browse files
Fix caching of WASM resources on localhost
1 parent 475fc56 commit 755949b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Components/Web.JS/dist/Release/blazor.webassembly.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Components/Web.JS/src/Platform/WebAssemblyResourceLoader.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,9 @@ async function getCacheToUseIfEnabled(bootConfig: BootJsonData): Promise<Cache |
165165
return null;
166166
}
167167

168-
// cache integrity is compromised if the first request has been served over http
168+
// cache integrity is compromised if the first request has been served over http (except localhost)
169169
// in this case, we want to disable caching and integrity validation
170-
if (document.location.protocol !== 'https:') {
170+
if (window.isSecureContext === false) {
171171
return null;
172172
}
173173

0 commit comments

Comments
 (0)