Fix models mechanism for default rule syntax
Co-authored-by: Kevin Pollet <pollet.kevin@gmail.com>
This commit is contained in:
parent
536e11d949
commit
2b35c7e205
2 changed files with 12 additions and 11 deletions
|
@ -2,6 +2,7 @@ package server
|
|||
|
||||
import (
|
||||
"slices"
|
||||
"strings"
|
||||
|
||||
"github.com/go-acme/lego/v4/challenge/tlsalpn01"
|
||||
"github.com/rs/zerolog/log"
|
||||
|
@ -156,7 +157,11 @@ func applyModel(cfg dynamic.Configuration) dynamic.Configuration {
|
|||
router := rt.DeepCopy()
|
||||
|
||||
if !router.DefaultRule && router.RuleSyntax == "" {
|
||||
for _, model := range cfg.HTTP.Models {
|
||||
for modelName, model := range cfg.HTTP.Models {
|
||||
// models cannot be provided by another provider than the internal one.
|
||||
if !strings.HasSuffix(modelName, "@internal") {
|
||||
continue
|
||||
}
|
||||
router.RuleSyntax = model.DefaultRuleSyntax
|
||||
break
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue