From 92b9212b31d686fee2cba9647f0093257cc838ce Mon Sep 17 00:00:00 2001 From: dami Date: Thu, 23 Apr 2026 00:12:57 +0800 Subject: [PATCH] update --- plugins/openresty/index.py | 25 ++++++++++++++++++++ plugins/openresty/versions/1.17.8/install.sh | 12 ++++++++-- plugins/openresty/versions/1.19.3/install.sh | 12 ++++++++-- plugins/openresty/versions/1.21.4/install.sh | 12 ++++++++-- plugins/openresty/versions/1.25.3/install.sh | 12 ++++++++-- plugins/openresty/versions/1.27.1/install.sh | 21 +++++++++++----- plugins/openresty/versions/1.29.2/install.sh | 18 ++++++++++---- 7 files changed, 93 insertions(+), 19 deletions(-) diff --git a/plugins/openresty/index.py b/plugins/openresty/index.py index 5f0d98966..ccf1a1981 100755 --- a/plugins/openresty/index.py +++ b/plugins/openresty/index.py @@ -577,6 +577,31 @@ def setCfg(): if not re.search(r"\d+", v): return mw.returnJson(False, '参数值错误,请输入数字整数') + if k == "brotli": + if v == "on": + # 批量替换所有以 #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": + # 批量替换所有以 brotli 开头且没有 # 前缀的指令为 #brotli + rep_var = r"(?