Compare commits

..

1 Commits

Author SHA1 Message Date
xream
1b48da5484 feat: 增强 VMess URI 解析兼容性; 修改导出文件名格式 2025-03-13 20:19:05 +08:00
4 changed files with 5 additions and 18 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "sub-store",
"version": "2.18.5",
"version": "2.18.3",
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.",
"main": "src/main.js",
"scripts": {

View File

@@ -342,7 +342,7 @@ function URI_VMess() {
};
const parse = (line) => {
line = line.split('vmess://')[1];
let content = Base64.decode(line.replace(/\?.*?$/, ''));
let content = Base64.decode(line.replace(/\?.*$/, ''));
if (/=\s*vmess/.test(content)) {
// Quantumult VMess URI format
const partitions = content.split(',').map((p) => p.trim());

View File

@@ -75,8 +75,6 @@ function Clash() {
// 是否被引号包裹
if (/^(['"]).*\1$/.test(afterTrim)) {
return `short-id: ${afterTrim}`;
} else if (['null'].includes(afterTrim)) {
return `short-id: ${afterTrim}`;
} else {
return `short-id: "${afterTrim}"`;
}

View File

@@ -360,12 +360,7 @@ export function HTTP(defaultOptions = { baseURL: '' }) {
}
if (isNode) {
const undici = eval("require('undici')");
const {
ProxyAgent,
EnvHttpProxyAgent,
request,
interceptors,
} = undici;
const { ProxyAgent, EnvHttpProxyAgent, request } = undici;
const agentOpts = {
connect: {
rejectUnauthorized:
@@ -392,18 +387,12 @@ export function HTTP(defaultOptions = { baseURL: '' }) {
const response = await request(opts.url, {
...opts,
method: method.toUpperCase(),
dispatcher: (opts.proxy
dispatcher: opts.proxy
? new ProxyAgent({
...agentOpts,
uri: opts.proxy,
})
: new EnvHttpProxyAgent(agentOpts)
).compose(
interceptors.redirect({
maxRedirections: 3,
throwOnMaxRedirects: true,
}),
),
: new EnvHttpProxyAgent(agentOpts),
});
resolve({
statusCode: response.statusCode,