Browse Source

always use 'all_others' or 'all' after every other path configuration (#2798)

pull/2800/head
Alessandro Ros 1 year ago committed by GitHub
parent
commit
15e6c199b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      internal/core/path_manager.go

12
internal/core/path_manager.go

@ -48,7 +48,17 @@ func getConfForPath(pathConfs map[string]*conf.Path, name string) (string, *conf @@ -48,7 +48,17 @@ func getConfForPath(pathConfs map[string]*conf.Path, name string) (string, *conf
// regular expression-based path
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)
if m != nil {
return pathConfName, pathConf, m, nil

Loading…
Cancel
Save