mirror of
https://github.com/livekit/livekit.git
synced 2026-03-31 00:15:38 +00:00
* feat: unpublish tracks after publish permissions are revoked. Uses protocol 7 to indicate client support, otherwise it attempts to mute the tracks. Also sends back permissions objects of all participants, and cleaned up our handling of various permissions attributes. * fix static check
25 lines
565 B
Go
25 lines
565 B
Go
package service
|
|
|
|
import (
|
|
"net/http"
|
|
"regexp"
|
|
|
|
"github.com/livekit/protocol/logger"
|
|
)
|
|
|
|
func handleError(w http.ResponseWriter, status int, msg string) {
|
|
// GetLogger already with extra depth 1
|
|
logger.GetLogger().V(1).Info("error handling request", "error", msg, "status", status)
|
|
w.WriteHeader(status)
|
|
_, _ = w.Write([]byte(msg))
|
|
}
|
|
|
|
func boolValue(s string) bool {
|
|
return s == "1" || s == "true"
|
|
}
|
|
|
|
func IsValidDomain(domain string) bool {
|
|
domainRegexp := regexp.MustCompile(`^(?i)[a-z0-9-]+(\.[a-z0-9-]+)+\.?$`)
|
|
return domainRegexp.MatchString(domain)
|
|
}
|