From a430aaee97279be92adbde2d35fc4e7944c4197e Mon Sep 17 00:00:00 2001 From: dami Date: Thu, 23 Apr 2026 00:19:46 +0800 Subject: [PATCH] Update index.py --- plugins/openresty/index.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/openresty/index.py b/plugins/openresty/index.py index ccf1a1981..1cb65f5a2 100755 --- a/plugins/openresty/index.py +++ b/plugins/openresty/index.py @@ -579,8 +579,8 @@ def setCfg(): if k == "brotli": if v == "on": - # 批量替换所有以 #brotli 开头的指令为 brotli - rep_var = r"#brotli[\w_]*\s+[^\;\n]+" + # 批量替换所有以 #brotli 等开头的指令为 brotli + rep_var = r"#+brotli[\w_]*\s+[^\;\n]+" newconf = lambda m: m.group(0).lstrip('#') content = re.sub(rep_var, newconf, content) if v == "off": @@ -593,7 +593,7 @@ def setCfg(): if k == "zstd": if v == "on": # 批量替换所有以 #zstd 开头的指令为 zstd - rep_var = r"#zstd[\w_]*\s+[^\;\n]+" + rep_var = r"#+zstd[\w_]*\s+[^\;\n]+" newconf = lambda m: m.group(0).lstrip('#') content = re.sub(rep_var, newconf, content) if v == "off":