fix: fall back on proxy error responses

This commit is contained in:
openclaw 2026-07-28 19:23:07 +08:00
parent e663f887cc
commit d99ae4c25c
1 changed files with 1 additions and 0 deletions

View File

@ -123,6 +123,7 @@ self.addEventListener("fetch", (event) => {
if (event.request.mode === "navigate") {
event.respondWith(
fetch(event.request).then((response) => {
if (!response.ok) throw new Error("navigation unavailable");
const copy = response.clone();
void caches.open(CACHE_NAME).then((cache) => cache.put("/", copy));
return response;