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
+7 -2
View File
@@ -851,6 +851,7 @@ func serveIMTenantEntryFeedback(wrt http.ResponseWriter, req *http.Request) {
func imPublicEndpoints(req *http.Request) map[string]any {
base := imPublicHTTPBase(req)
httpBase := strings.TrimRight(base, "/")
wsBase := base
if strings.HasPrefix(wsBase, "https://") {
wsBase = "wss://" + strings.TrimPrefix(wsBase, "https://")
@@ -863,8 +864,12 @@ func imPublicEndpoints(req *http.Request) map[string]any {
}
return map[string]any{
"websocket": wsEndpoint,
"api": strings.TrimRight(base, "/") + "/v1/im",
"file": strings.TrimRight(base, "/") + "/v0/file",
"api": httpBase + "/v1/im",
"file": httpBase + "/v0/file",
"legal": map[string]any{
"user_terms": httpBase + "/legal/user-terms",
"privacy_policy": httpBase + "/legal/privacy-policy",
},
}
}