Snapshot: full project state
This commit is contained in:
15
patch_shim.py
Normal file
15
patch_shim.py
Normal file
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Add double-load guard to SatsSpin auth shim (prevents fetch recursion)."""
|
||||
import io
|
||||
|
||||
P = "/opt/casino/dist/shim.js"
|
||||
src = io.open(P, encoding="utf-8").read()
|
||||
guard = " if (window.__satsspinShimLoaded) { return; }\n window.__satsspinShimLoaded = true;\n"
|
||||
old = "(function () {\n 'use strict';\n"
|
||||
assert old in src, "IIFE start not found"
|
||||
if "__satsspinShimLoaded" not in src:
|
||||
src = src.replace(old, old + guard, 1)
|
||||
io.open(P, "w", encoding="utf-8").write(src)
|
||||
print("SHIM GUARDED")
|
||||
else:
|
||||
print("ALREADY GUARDED")
|
||||
Reference in New Issue
Block a user