mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-08-11 11:28:59 +08:00
修复IP-CIDR的option错误
This commit is contained in:
parent
81adfbc461
commit
2a87f7b3c3
@ -9,7 +9,7 @@ const RULE_TYPES_MAPPING = [
|
|||||||
[/^(IN|SRC)-PORT$/, 'IN-PORT'],
|
[/^(IN|SRC)-PORT$/, 'IN-PORT'],
|
||||||
[/^PROTOCOL$/, 'PROTOCOL'],
|
[/^PROTOCOL$/, 'PROTOCOL'],
|
||||||
[/^IP-CIDR$/i, 'IP-CIDR'],
|
[/^IP-CIDR$/i, 'IP-CIDR'],
|
||||||
[/^(IP-CIDR6|ip6-cidr|IP6-CIDR)$/],
|
[/^(IP-CIDR6|ip6-cidr|IP6-CIDR)$/, 'IP-CIDR6'],
|
||||||
];
|
];
|
||||||
|
|
||||||
function AllRuleParser() {
|
function AllRuleParser() {
|
||||||
@ -40,7 +40,7 @@ function AllRuleParser() {
|
|||||||
rule.type === 'IP-CIDR' ||
|
rule.type === 'IP-CIDR' ||
|
||||||
rule.type === 'IP-CIDR6'
|
rule.type === 'IP-CIDR6'
|
||||||
) {
|
) {
|
||||||
rule.options = params.slice(2);
|
rule.options = params.slice(2).join(",");
|
||||||
}
|
}
|
||||||
result.push(rule);
|
result.push(rule);
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ function SurgeRuleSet() {
|
|||||||
const func = (rule) => {
|
const func = (rule) => {
|
||||||
let output = `${rule.type},${rule.content}`;
|
let output = `${rule.type},${rule.content}`;
|
||||||
if (rule.type === 'IP-CIDR' || rule.type === 'IP-CIDR6') {
|
if (rule.type === 'IP-CIDR' || rule.type === 'IP-CIDR6') {
|
||||||
output += rule.options ? `,${rule.options[0]}` : '';
|
output += rule.options ? `,${rule.options}` : '';
|
||||||
}
|
}
|
||||||
return output;
|
return output;
|
||||||
};
|
};
|
||||||
@ -63,7 +63,7 @@ function ClashRuleProvider() {
|
|||||||
rule.content
|
rule.content
|
||||||
}`;
|
}`;
|
||||||
if (rule.type === 'IP-CIDR' || rule.type === 'IP-CIDR6') {
|
if (rule.type === 'IP-CIDR' || rule.type === 'IP-CIDR6') {
|
||||||
output += rule.options ? `,${rule.options[0]}` : '';
|
output += rule.options ? `,${rule.options}` : '';
|
||||||
}
|
}
|
||||||
return output;
|
return output;
|
||||||
}),
|
}),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user