feat(sub): refine Happ routing presets, serverDescription escaping, and auto-detect placement (#6488)

* feat(sub): refine Happ routing presets, serverDescription escaping, and auto-detect placement

* fix(sub): address PR review findings on routing parity, agent regex, and i18n
This commit is contained in:
Pejman Yousefi
2026-09-13 14:23:57 +03:30
committed by GitHub
parent c7518c4038
commit cba8f0672f
10 changed files with 306 additions and 166 deletions
+4 -4
View File
@@ -116,8 +116,8 @@ func TestBuildEndpointVmessLinks(t *testing.T) {
}
}
// happ.su documents serverDescription as a "#title?serverDescription=<base64>"
// link parameter, never a key of the VMess object, so nothing may leak into it.
// happ.su documents serverDescription for VMess as a JSON object key
// {"add":"...","ps":"...","serverDescription":"Happ the best"}.
func TestBuildEndpointVmessLinks_HostServerDescription(t *testing.T) {
s := &SubService{}
in := &model.Inbound{Remark: "ib"}
@@ -137,8 +137,8 @@ func TestBuildEndpointVmessLinks_HostServerDescription(t *testing.T) {
if obj["add"] != "a.example.com" {
t.Fatalf("host endpoint not applied: add = %v", obj["add"])
}
if value, ok := obj["serverDescription"]; ok {
t.Fatalf("VMess object carries serverDescription = %v; it is not a VMess object key", value)
if obj["serverDescription"] != "Berlin premium" {
t.Fatalf("VMess object missing serverDescription: got %v, want Berlin premium", obj["serverDescription"])
}
}