mirror of
https://github.com/nitezs/sub2clash.git
synced 2024-12-23 11:34:42 -05:00
🐛 fix #37
This commit is contained in:
parent
7158ad467a
commit
dedbf2bc03
1
.gitignore
vendored
1
.gitignore
vendored
@ -6,3 +6,4 @@ data
|
||||
.env
|
||||
.vscode/settings.json
|
||||
test
|
||||
*test.go
|
@ -179,6 +179,10 @@ async function parseInputURL() {
|
||||
let hash = url.pathname.substring(url.pathname.lastIndexOf("/s/") + 3);
|
||||
let q = new URLSearchParams();
|
||||
let password = url.searchParams.get("password");
|
||||
if (password === null) {
|
||||
alert("仅可解析加密短链");
|
||||
return;
|
||||
}
|
||||
q.append("hash", hash);
|
||||
q.append("password", password);
|
||||
try {
|
||||
|
@ -72,6 +72,14 @@ func ParseHysteria2(proxy string) (model.Proxy, error) {
|
||||
enableTLS := pinSHA256 != ""
|
||||
insecureBool := insecure == "1"
|
||||
|
||||
if remarks == "" {
|
||||
remarksIndex := strings.LastIndex(proxy, "#")
|
||||
if remarksIndex != -1 {
|
||||
remarks = proxy[remarksIndex:]
|
||||
remarks, _ = url.QueryUnescape(remarks)
|
||||
}
|
||||
}
|
||||
|
||||
result := model.Proxy{
|
||||
Type: "hysteria2",
|
||||
Name: remarks,
|
||||
|
Loading…
Reference in New Issue
Block a user