forked from MapComplete/MapComplete
Drop goatcounter
This commit is contained in:
parent
673cf95119
commit
5851fecffd
12 changed files with 5 additions and 36 deletions
|
@ -154,20 +154,7 @@ describe("Code quality", () => {
|
|||
)
|
||||
)
|
||||
|
||||
test("scripts with external sources should have an integrity hash", async () => {
|
||||
const htmlFiles = ScriptUtils.readDirRecSync(".", 1).filter((f) => f.endsWith(".html"))
|
||||
for (const htmlFile of htmlFiles) {
|
||||
await validateScriptIntegrityOf(htmlFile)
|
||||
}
|
||||
const goatCounter = "https://gc.zgo.at/count.js"
|
||||
const data: string = (await ScriptUtils.Download(goatCounter))["content"]
|
||||
const hashed = await webcrypto.subtle.digest("SHA-384", new TextEncoder().encode(data))
|
||||
const hashedB64 = _arrayBufferToBase64(hashed)
|
||||
const goatCounterScript = readFileSync("./src/loadGoatcounter.js", "utf-8")
|
||||
if (goatCounterScript.indexOf(hashedB64) < 0) {
|
||||
throw "Hash sha-384" + hashedB64 + " not found in 'loadGoatcounter.js'"
|
||||
}
|
||||
})
|
||||
|
||||
/*
|
||||
itAsync(
|
||||
"should not contain 'import * as name from \"xyz.json\"'",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue