-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Open
Labels
area-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor Components
Milestone
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
Fingerprint for resource-collection isn't correctly computed when WasmFingerprintAssets=false
for published application
counter:1 Failed to find a valid digest in the 'integrity' attribute for resource 'http://localhost:5000/_framework/resource-collection._wK-0.js' with computed SHA-256 integrity '8AX6Bh1INkeyvSAIk8gUqxjb+QPL2TfoxeyIrM1JZD0='. The resource has been blocked.
Expected Behavior
No response
Steps To Reproduce
dotnet new blazor -int WebAssembly -o BlazorWebWasm
dotnet publish -p:WasmFingerprintAssets=false
cd BlazorWebWasm\BlazorWebWasm\bin\Release\net10.0\publish\
dotnet exec .\BlazorWebWasm.dll
- Open the app in browser to store the file in cache
- Change
Counter.razor
in client project - Publish and run the app again
- Open in browser
The request will be served from the cache, but the import map integrity will have a different value.
The fingerprint for resource-collection.js is computed only from file names contained inside, but not for hashes (integrity) of those files.
aspnetcore/src/Components/Endpoints/src/Builder/ResourceCollectionUrlEndpoint.cs
Lines 119 to 120 in b50ab86
var url = resource.Url; | |
AppendToHash(incrementalHash, buffer, ref rented, url); |
The problem occurs if user changes just user files (eg. styles) in wwwroot between two publishes
Exceptions (if any)
None
.NET Version
10.0.100-rc.2.25501.103
Anything else?
No response
Metadata
Metadata
Assignees
Labels
area-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor Components