Merge pull request #1723 from slingamn/vhost_validation

fix #1722
This commit is contained in:
Shivaram Lingamneni
2021-07-04 01:41:38 -04:00
committed by GitHub
+3
View File
@@ -830,6 +830,9 @@ func (conf *Config) Operators(oc map[string]*OperClass) (map[string]*Oper, error
}
oper.Vhost = opConf.Vhost
if oper.Vhost != "" && !conf.Accounts.VHosts.validRegexp.MatchString(oper.Vhost) {
return nil, fmt.Errorf("Oper %s has an invalid vhost: `%s`", name, oper.Vhost)
}
class, exists := oc[opConf.Class]
if !exists {
return nil, fmt.Errorf("Could not load operator [%s] - they use operclass [%s] which does not exist", name, opConf.Class)