mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2025-01-17 03:40:07 +08:00
wip
This commit is contained in:
parent
b13b574d25
commit
53000f59b1
@ -83,7 +83,17 @@ async function handleEvent(event) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
const page = await getAssetFromKV(event, options);
|
let page;
|
||||||
|
try {
|
||||||
|
page = await getAssetFromKV(event, options);
|
||||||
|
} catch (e) {
|
||||||
|
// Try adding .html
|
||||||
|
options.mapRequestToAsset = function(request) {
|
||||||
|
return new Request(url.toString() + ".html", defaultAssetKey);
|
||||||
|
};
|
||||||
|
|
||||||
|
page = await getAssetFromKV(event, options);
|
||||||
|
}
|
||||||
|
|
||||||
// allow headers to be altered
|
// allow headers to be altered
|
||||||
response = new Response(page.body, page);
|
response = new Response(page.body, page);
|
||||||
|
Loading…
Reference in New Issue
Block a user