sh1k4ku commited on
Commit
a31ceda
·
verified ·
1 Parent(s): bcb086f

Upload index.html with huggingface_hub

Browse files
Files changed (1) hide show
  1. index.html +5 -1
index.html CHANGED
@@ -409,8 +409,12 @@ let harness, bbInstall, bbRun; // JS-side proxies; harness state stays in clos
409
  // public function is exposed as "blackbox"; the oracle/bugs/reasons stay in the closure.
410
  async function loadProblem(key) {
411
  if (!pyodide) return; // not ready yet; startup will load the current prob
412
- const b64 = (await (await fetch(PROBLEMS[key].data)).text()).trim();
 
413
  const src = await decryptDat(b64);
 
 
 
414
  bbInstall(PROBLEMS[key].public, src);
415
  modinfo.textContent = key + " · " + PROBLEMS[key].sig;
416
  }
 
409
  // public function is exposed as "blackbox"; the oracle/bugs/reasons stay in the closure.
410
  async function loadProblem(key) {
411
  if (!pyodide) return; // not ready yet; startup will load the current prob
412
+ // no-store: never reuse a stale (e.g. pre-encryption) .dat from the browser cache
413
+ const b64 = (await (await fetch(PROBLEMS[key].data, { cache: "no-store" })).text()).trim();
414
  const src = await decryptDat(b64);
415
+ if (!src.includes("def blackbox") || /[\u0000-\u0008]/.test(src)) {
416
+ throw new Error("Could not decrypt " + PROBLEMS[key].data + " — try a hard refresh (Cmd/Ctrl+Shift+R).");
417
+ }
418
  bbInstall(PROBLEMS[key].public, src);
419
  modinfo.textContent = key + " · " + PROBLEMS[key].sig;
420
  }