fix: include api key in tenant websocket endpoint
This commit is contained in:
+5
-1
@@ -856,8 +856,12 @@ func imPublicEndpoints(req *http.Request) map[string]any {
|
||||
} else if strings.HasPrefix(wsBase, "http://") {
|
||||
wsBase = "ws://" + strings.TrimPrefix(wsBase, "http://")
|
||||
}
|
||||
wsEndpoint := strings.TrimRight(wsBase, "/") + "/v0/channels"
|
||||
if apiKey := strings.TrimSpace(getAPIKey(req)); apiKey != "" {
|
||||
wsEndpoint += "?apikey=" + url.QueryEscape(apiKey)
|
||||
}
|
||||
return map[string]any{
|
||||
"websocket": strings.TrimRight(wsBase, "/") + "/v0/channels",
|
||||
"websocket": wsEndpoint,
|
||||
"api": strings.TrimRight(base, "/") + "/v1/im",
|
||||
"file": strings.TrimRight(base, "/") + "/v0/file",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user