diff --git a/api/stream/stream.go b/api/stream/stream.go index 5e8692f75..9ad54ee0d 100644 --- a/api/stream/stream.go +++ b/api/stream/stream.go @@ -196,7 +196,7 @@ func isAllowedOrigin(r *http.Request, allowedOrigins []*regexp.Regexp) bool { } for _, allowedOrigin := range allowedOrigins { - if allowedOrigin.Match([]byte(strings.ToLower(u.Hostname()))) { + if allowedOrigin.MatchString(strings.ToLower(u.Hostname())) { return true } } diff --git a/auth/cors.go b/auth/cors.go index ebf2afebd..3cfb1fedc 100644 --- a/auth/cors.go +++ b/auth/cors.go @@ -29,7 +29,7 @@ func CorsConfig(conf *config.Configuration) cors.Config { corsConf.AllowHeaders = conf.Server.Cors.AllowHeaders corsConf.AllowOriginFunc = func(origin string) bool { for _, compiledOrigin := range compiledOrigins { - if compiledOrigin.Match([]byte(strings.ToLower(origin))) { + if compiledOrigin.MatchString(strings.ToLower(origin)) { return true } }