forked from External/mediamtx
always use 'all_others' or 'all' after every other path configuration (#2798)
This commit is contained in:
parent
e06f4bc998
commit
15e6c199b4
1 changed files with 11 additions and 1 deletions
|
|
@ -48,7 +48,17 @@ func getConfForPath(pathConfs map[string]*conf.Path, name string) (string, *conf
|
||||||
|
|
||||||
// regular expression-based path
|
// regular expression-based path
|
||||||
for pathConfName, pathConf := range pathConfs {
|
for pathConfName, pathConf := range pathConfs {
|
||||||
if pathConf.Regexp != nil {
|
if pathConf.Regexp != nil && pathConfName != "all" && pathConfName != "all_others" {
|
||||||
|
m := pathConf.Regexp.FindStringSubmatch(name)
|
||||||
|
if m != nil {
|
||||||
|
return pathConfName, pathConf, m, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// process path configuration "all_others" after everything else
|
||||||
|
for pathConfName, pathConf := range pathConfs {
|
||||||
|
if pathConfName == "all" || pathConfName == "all_others" {
|
||||||
m := pathConf.Regexp.FindStringSubmatch(name)
|
m := pathConf.Regexp.FindStringSubmatch(name)
|
||||||
if m != nil {
|
if m != nil {
|
||||||
return pathConfName, pathConf, m, nil
|
return pathConfName, pathConf, m, nil
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue