mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-11-13 08:35:00 +03:00
fix(sub): send the serverDescription tail only to clients that read it (#7108)
A Host Description is appended to every raw-subscription node name as a base64 `?serverDescription=` tail. Only Happ and INCY read it; v2rayN, v2rayNG, OpenClash and the rest show it as part of the node name, and the only way out was clearing the Description (#7105). The raw subscription body now carries the tail only when the requesting User-Agent is Happ or INCY, for the endpoint links and the Hysteria2 loop alike. Copied links, QR codes and the panel's link export keep it, since the server cannot tell which client they end up in. Closes #7105
This commit is contained in:
@@ -52,6 +52,9 @@ func TestGenHysteriaLinkAppendsHostServerDescription(t *testing.T) {
|
||||
if !strings.HasSuffix(got, "?serverDescription=V2ktRmk=") {
|
||||
t.Fatalf("host serverDescription missing from fragment.\n got: %s\nwant suffix: ?serverDescription=V2ktRmk=", got)
|
||||
}
|
||||
if got := (&SubService{omitServerDescription: true}).genHysteriaLink(in, "user"); strings.Contains(got, "serverDescription") {
|
||||
t.Fatalf("tail not omitted: %s", got)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user