Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(generator/ruleconvert): clash rule-provider without payload: #752

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ChrAlpha
Copy link

@ChrAlpha ChrAlpha commented May 5, 2024

what & why

#751

how

在判断 payload: 同级的位置增加 type==RULESET_CLASH_DOMAIN 或者 type=RULESET_CLASH_IPCIDR

并在确认 type 为 clash-domain 时仅仅解析为域名规则、在确认 type 为 clash-ipcidr 时仅仅解析为 IP 规则

test

通过这个 测试 config,无论是原本带 payload: 的 ruleset 和我希望修复的开头不带 payload: 的 ruleset 都能正常解析。

btw

对行单独(用正则表达式)判断是否为域名或者 IP,并在 type 为 clash-domain 时候仅解析是域名的行(IP 同理),而非和原来一样通过 DOMAIN, 兜底一切行内容,或许会使程序更具鲁棒性。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant