feat: expose public legal agreement pages

This commit is contained in:
richjohnrambo
2026-09-12 14:18:24 +08:00
parent ff432bc3ce
commit 2728f35069
10 changed files with 2172 additions and 2 deletions
+10
View File
@@ -1633,6 +1633,11 @@ func TestServeIMTenantResolveSuccessFromHeader(t *testing.T) {
if endpoints["websocket"] != "wss://im.example.com/v0/channels?apikey="+url.QueryEscape(apiKey) {
t.Fatalf("unexpected websocket endpoint: %#v", endpoints)
}
legal := endpoints["legal"].(map[string]any)
if legal["user_terms"] != "https://im.example.com/legal/user-terms" ||
legal["privacy_policy"] != "https://im.example.com/legal/privacy-policy" {
t.Fatalf("unexpected legal endpoints: %#v", legal)
}
}
func TestIMHTTPProtocolDoesNotRequireIdempotencyForTenantResolve(t *testing.T) {
@@ -1688,6 +1693,11 @@ func TestServeIMTenantResolveUsesForwardedPublicHost(t *testing.T) {
endpoints["file"] != "https://api.118im.com/v0/file" {
t.Fatalf("unexpected endpoints: %#v", endpoints)
}
legal := endpoints["legal"].(map[string]any)
if legal["user_terms"] != "https://api.118im.com/legal/user-terms" ||
legal["privacy_policy"] != "https://api.118im.com/legal/privacy-policy" {
t.Fatalf("unexpected legal endpoints: %#v", legal)
}
}
func TestServeIMTenantResolveSuccessFromBody(t *testing.T) {