Skip to content

Commit bc7e2f2

Browse files
Update with latest changes from dotnet/aspnetcore#64612, update AppHost, and move code workspace to repo root
1 parent caaa7c1 commit bc7e2f2

4 files changed

Lines changed: 9 additions & 11 deletions

File tree

BlazorWasmOsmOauth.AppHost/BlazorWasmOsmOauth.AppHost.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Aspire.AppHost.Sdk/13.0.0">
1+
<Project Sdk="Aspire.AppHost.Sdk/13.1.0">
22
<PropertyGroup>
33
<OutputType>Exe</OutputType>
44
<TargetFramework>net10.0</TargetFramework>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"folders": [
33
{
4-
"path": ".."
4+
"path": "."
55
}
66
],
77
"settings": {}

BlazorWasmOsmOauth/wwwroot/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
</div>
3232

3333
<script src="_framework/blazor.webassembly.js"></script>
34-
<script>navigator.serviceWorker.register('service-worker.js');</script>
34+
<script>navigator.serviceWorker.register('service-worker.js', { updateViaCache: 'none' });</script>
3535
<script type="module">
3636
import { BrotliDecode } from './decode.min.js';
3737
Blazor.start({

BlazorWasmOsmOauth/wwwroot/service-worker.published.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,13 @@ async function onFetch(event) {
5151
cachedResponse = await cache.match(request);
5252
}
5353

54-
// Fix for Cloudflare Pages, see: https://github.com/dotnet/aspnetcore/issues/33872
5554
if (cachedResponse && cachedResponse.redirected) {
56-
cachedResponse =
57-
new Response(cachedResponse.body,
58-
{
59-
headers: cachedResponse.headers,
60-
status: cachedResponse.status,
61-
statusText: cachedResponse.statusText
62-
});
55+
const clonedResponse = cachedResponse.clone();
56+
cachedResponse = new Response(clonedResponse.body, {
57+
headers: clonedResponse.headers,
58+
status: clonedResponse.status,
59+
statusText: clonedResponse.statusText
60+
});
6361
}
6462

6563
return cachedResponse || fetch(event.request);

0 commit comments

Comments
 (0)