Skip to content

Commit 31ead7e

Browse files
committed
feat: Beta 版支持对 AND|OR|NOT 逻辑规则 开启 Surge 的 SNI 扩展匹配(extended-matching)
1 parent 6cd6dd9 commit 31ead7e

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

Rewrite-Parser.beta.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,12 @@ if (binaryInfo != null && binaryInfo.length > 0) {
360360
if (sni != null) {
361361
for (let i = 0; i < sni.length; i++) {
362362
const elem = sni[i].trim()
363-
if (x.indexOf(elem) != -1 && /^(DOMAIN|RULE-SET)/i.test(x) && !/,\s*extended-matching/i.test(x)) {
363+
// 加入对逻辑规则的判断
364+
if (
365+
x.indexOf(elem) != -1 &&
366+
(/^(DOMAIN|RULE-SET)/i.test(x) || /AND|OR|NOT\s*\?\s*?\,\s*?\(\s*?\(.+/i.test(x)) &&
367+
!/,\s*extended-matching/i.test(x)
368+
) {
364369
x = x + ',extended-matching'
365370
break
366371
}

0 commit comments

Comments
 (0)