dont work on cf

This commit is contained in:
sky
2026-02-14 16:57:38 -05:00
parent c63b9716cd
commit 4bedce429e
2 changed files with 190 additions and 175 deletions

View File

@ -57,9 +57,13 @@ async function caching() {
if(sessionStorage.getItem("cdns")) return "done";
let cdns = JSON.parse(atob("WyJodHRwczovL2NhY2hpbmcuZnJlZXRscy5mYXN0bHkubmV0IiwiaHR0cHM6Ly9jYWNoaW5nLmdsb2JhbC5zc2wuZmFzdGx5Lm5ldCJd"));
let goods = [];
let cfStatus = (await fetch("/alive.txt")).headers.get("Cf-Ray") != null;
if(cfStatus) {
localStorage.setItem("selenite.disableCDN", "true");
return;
}
for(let i = 0;i<cdns.length;i++) {
let cdn = cdns[i];
// TODO: change to alive.txt
await fetch(cdn + "/alive.txt")
.then(data => data.text())
.then(data => {