Fix: service worker only intercepts same-origin requests, preventing CDN fetch errors
This commit is contained in:
parent
3893e91606
commit
db4815b7a9
2 changed files with 5 additions and 2 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
services:
|
services:
|
||||||
pediatric-scribe:
|
pediatric-scribe:
|
||||||
image: danielonyejesi/pediatric-ai-scribe-v3:v1.5
|
image: danielonyejesi/pediatric-ai-scribe-v3:v1.6
|
||||||
ports:
|
ports:
|
||||||
- "3552:3000"
|
- "3552:3000"
|
||||||
env_file:
|
env_file:
|
||||||
|
|
|
||||||
|
|
@ -15,5 +15,8 @@ self.addEventListener('activate', function(event) {
|
||||||
});
|
});
|
||||||
|
|
||||||
self.addEventListener('fetch', function(event) {
|
self.addEventListener('fetch', function(event) {
|
||||||
event.respondWith(fetch(event.request));
|
// Only intercept same-origin requests — let external CDNs go through natively
|
||||||
|
if (event.request.url.startsWith(self.location.origin)) {
|
||||||
|
event.respondWith(fetch(event.request));
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue