Change how UsesRegex is determined
This commit is contained in:
parent
ece4a91ec3
commit
06466faa87
1 changed files with 2 additions and 2 deletions
|
@ -27,13 +27,13 @@ type HeaderConfig struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (config *HeaderConfig) Init() {
|
func (config *HeaderConfig) Init() {
|
||||||
if config.UsesRegex() {
|
if len(config.Regex) > 0 {
|
||||||
config.CompiledRegex = regexp.MustCompile(config.Regex)
|
config.CompiledRegex = regexp.MustCompile(config.Regex)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (config *HeaderConfig) UsesRegex() bool {
|
func (config *HeaderConfig) UsesRegex() bool {
|
||||||
return len(config.Regex) > 0
|
return config.CompiledRegex != nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// HeaderDefiniton is a key value pair of a specified header rule
|
// HeaderDefiniton is a key value pair of a specified header rule
|
||||||
|
|
Loading…
Reference in a new issue