site specific flags

This commit is contained in:
velzie 2024-10-13 14:43:51 -04:00
parent 0906dd78a9
commit 920bbd8d69
No known key found for this signature in database
GPG key ID: AA51AEFB0A1F3820
8 changed files with 34 additions and 11 deletions

View file

@ -1,3 +1,4 @@
import { flagEnabled } from "../../../scramjet";
import { config, unrewriteUrl, rewriteUrl } from "../../../shared";
import { ScramjetClient } from "../../client";
let nativeworker;
@ -35,8 +36,8 @@ export default function (client: ScramjetClient, self: Self) {
const args = ctx.this[ARGS];
if (!args || args[2]) return;
if (!self.$scramjet.config.flags.syncxhr) {
console.warn("sync xhr disabled in flags");
if (!flagEnabled("syncxhr", client.url)) {
console.warn("ignoring request - sync xhr disabled in flags");
return;
}