mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-08-10 00:09:01 +08:00
修复分流解析错误的问题
This commit is contained in:
parent
1398782595
commit
18164a0c7d
@ -2643,13 +2643,15 @@ var RuleUtils = (function () {
|
||||
const parse = (raw) => {
|
||||
const lines = raw.split("\n");
|
||||
for (let i = 0; i < lines.length; i++) {
|
||||
lines[i] = lines[i]
|
||||
.replace(/host-suffix/i, "DOMAIN-SUFFIX")
|
||||
.replace(/host-keyword/i, "DOMAIN-KEYWORD")
|
||||
let type = lines[i].split(",")[0];
|
||||
type = type
|
||||
.replace(/host/i, "DOMAIN")
|
||||
.replace(/-suffix/, "-SUFFIX")
|
||||
.replace(/-keyword/, "-KEYWORD")
|
||||
.replace("ip-cidr", "IP-CIDR")
|
||||
.replace(/ip6-cidr/i, "IP-CIDR6")
|
||||
.replace("user-agent", "USER-AGENT");
|
||||
lines[i] = type + "," + lines[i].split(",")[1];
|
||||
}
|
||||
return SurgeRuleSet().parse(lines.join("\n"));
|
||||
};
|
||||
|
4
backend/sub-store.min.js
vendored
4
backend/sub-store.min.js
vendored
File diff suppressed because one or more lines are too long
@ -2054,13 +2054,15 @@ var RuleUtils = (function () {
|
||||
const parse = (raw) => {
|
||||
const lines = raw.split("\n");
|
||||
for (let i = 0; i < lines.length; i++) {
|
||||
lines[i] = lines[i]
|
||||
.replace(/host-suffix/i, "DOMAIN-SUFFIX")
|
||||
.replace(/host-keyword/i, "DOMAIN-KEYWORD")
|
||||
let type = lines[i].split(",")[0];
|
||||
type = type
|
||||
.replace(/host/i, "DOMAIN")
|
||||
.replace(/-suffix/, "-SUFFIX")
|
||||
.replace(/-keyword/, "-KEYWORD")
|
||||
.replace("ip-cidr", "IP-CIDR")
|
||||
.replace(/ip6-cidr/i, "IP-CIDR6")
|
||||
.replace("user-agent", "USER-AGENT");
|
||||
lines[i] = type + "," + lines[i].split(",")[1];
|
||||
}
|
||||
return SurgeRuleSet().parse(lines.join("\n"));
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user