mirror of
https://github.com/openlibrecommunity/olcrtc.git
synced 2026-06-08 13:24:44 +00:00
fix(telemost): exclude TURN/TURNS URLs from server hello config
This commit is contained in:
@@ -698,12 +698,16 @@ func (p *Peer) applyServerHelloConfig(serverHello map[string]interface{}) {
|
||||
switch rawURLs := server["urls"].(type) {
|
||||
case []interface{}:
|
||||
for _, rawURL := range rawURLs {
|
||||
if url, ok := rawURL.(string); ok && url != "" {
|
||||
if url, ok := rawURL.(string); ok && url != "" && !strings.HasPrefix(url, "turn:") && !strings.HasPrefix(url, "turns:") {
|
||||
urls = append(urls, url)
|
||||
}
|
||||
}
|
||||
case []string:
|
||||
urls = append(urls, rawURLs...)
|
||||
for _, url := range rawURLs {
|
||||
if !strings.HasPrefix(url, "turn:") && !strings.HasPrefix(url, "turns:") {
|
||||
urls = append(urls, url)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if len(urls) == 0 {
|
||||
|
||||
Reference in New Issue
Block a user