mirror of
https://github.com/sub-store-org/Sub-Store.git
synced 2026-11-30 08:28:10 +00:00
fix: 修复 WireGuard URI 编码问题
This commit is contained in:
2 files changed
+13
-5
No files matched your search
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "sub-store",
|
||||
"version": "2.21.57",
|
||||
"version": "2.21.58",
|
||||
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.",
|
||||
"main": "src/main.js",
|
||||
"scripts": {
|
||||
|
||||
@@ -807,7 +807,9 @@ export default function URI_Producer() {
|
||||
].includes(key)
|
||||
) {
|
||||
if (['public-key'].includes(key)) {
|
||||
wireguardParams.push(`publickey=${proxy[key]}`);
|
||||
wireguardParams.push(
|
||||
`publickey=${encodeURIComponent(proxy[key])}`,
|
||||
);
|
||||
} else if (['udp'].includes(key)) {
|
||||
if (proxy[key]) {
|
||||
wireguardParams.push(`${key}=1`);
|
||||
@@ -821,12 +823,18 @@ export default function URI_Producer() {
|
||||
});
|
||||
if (proxy.ip && proxy.ipv6) {
|
||||
wireguardParams.push(
|
||||
`address=${proxy.ip}/32,${proxy.ipv6}/128`,
|
||||
`address=${encodeURIComponent(
|
||||
`${proxy.ip}/32,${proxy.ipv6}/128`,
|
||||
)}`,
|
||||
);
|
||||
} else if (proxy.ip) {
|
||||
wireguardParams.push(`address=${proxy.ip}/32`);
|
||||
wireguardParams.push(
|
||||
`address=${encodeURIComponent(`${proxy.ip}/32`)}`,
|
||||
);
|
||||
} else if (proxy.ipv6) {
|
||||
wireguardParams.push(`address=${proxy.ipv6}/128`);
|
||||
wireguardParams.push(
|
||||
`address=${encodeURIComponent(`${proxy.ipv6}/128`)}`,
|
||||
);
|
||||
}
|
||||
result = `wireguard://${encodeURIComponent(
|
||||
proxy['private-key'],
|
||||
|
||||
Reference in new issue
Block a user