Update index.py

pull/887/head
dami 1 month ago
parent f4ee2ca3b9
commit a430aaee97
  1. 6
      plugins/openresty/index.py

@ -579,8 +579,8 @@ def setCfg():
if k == "brotli": if k == "brotli":
if v == "on": if v == "on":
# 批量替换所有以 #brotli 开头的指令为 brotli # 批量替换所有以 #brotli 开头的指令为 brotli
rep_var = r"#brotli[\w_]*\s+[^\;\n]+" rep_var = r"#+brotli[\w_]*\s+[^\;\n]+"
newconf = lambda m: m.group(0).lstrip('#') newconf = lambda m: m.group(0).lstrip('#')
content = re.sub(rep_var, newconf, content) content = re.sub(rep_var, newconf, content)
if v == "off": if v == "off":
@ -593,7 +593,7 @@ def setCfg():
if k == "zstd": if k == "zstd":
if v == "on": if v == "on":
# 批量替换所有以 #zstd 开头的指令为 zstd # 批量替换所有以 #zstd 开头的指令为 zstd
rep_var = r"#zstd[\w_]*\s+[^\;\n]+" rep_var = r"#+zstd[\w_]*\s+[^\;\n]+"
newconf = lambda m: m.group(0).lstrip('#') newconf = lambda m: m.group(0).lstrip('#')
content = re.sub(rep_var, newconf, content) content = re.sub(rep_var, newconf, content)
if v == "off": if v == "off":

Loading…
Cancel
Save