Skip to content

Commit

Permalink
Merge pull request #105 from koast18:main
Browse files Browse the repository at this point in the history
修复服务器名称解析中存在的问题
  • Loading branch information
7Sageer authored Feb 15, 2025
2 parents 3b38e71 + 2a2931e commit 84acdec
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,12 @@ export function parseServerInfo(serverInfo) {
const [paramsOnly, ...fragmentParts] = paramsPart.split('#');
const searchParams = new URLSearchParams(paramsOnly);
const params = Object.fromEntries(searchParams.entries());

const name = fragmentParts.length > 0 ? decodeURIComponent(fragmentParts.join('#')) : '';


let name = fragmentParts.length > 0 ? fragmentParts.join('#') : '';
try {
name = decodeURIComponent(name);
} catch (error) { };

return { addressPart, params, name };
}

Expand Down

0 comments on commit 84acdec

Please sign in to comment.