resRules
为匹配的请求在响应阶段批量设置多个规则,实现复杂场景下的请求处理需求。
规则语法
txt
pattern resRules://value [filters...]
参数 | 描述 | 详细文档 |
---|---|---|
pattern | 匹配请求 URL 的表达式 | 匹配模式文档 |
value | 规则内容,支持以下类型: • 目录/文件路径 • 远程 URL • 内联/内嵌/Values内容 | 操作指令文档 |
filters | 可选过滤器,支持匹配: • 请求URL/方法/头部/内容 • 响应状态码/头部 | 过滤器文档 |
配置示例
txt
``` test.txt
* file://(<div>hello<div>)
* resType://text
```
``` test2.txt
* resAppend://(test)
```
www.example.com/path resRules://{test.txt} resRules://{test2.txt}
访问 https://www.example.com/path/to
不执行 * file://(<div>hello<div>)
(因为是在响应阶段执行 resRules 里面的规则)。