logical/framework: Panic if routing pattern is blank
This commit is contained in:
parent
ca5c55c3eb
commit
faa759ea1d
|
@ -129,8 +129,11 @@ func (b *Backend) Secret(k string) *Secret {
|
|||
func (b *Backend) init() {
|
||||
b.pathsRe = make([]*regexp.Regexp, len(b.Paths))
|
||||
for i, p := range b.Paths {
|
||||
if len(p.Pattern) == 0 {
|
||||
panic(fmt.Sprintf("Routing pattern cannot be blank"))
|
||||
}
|
||||
// Automatically anchor the pattern
|
||||
if len(p.Pattern) > 0 && p.Pattern[0] != '^' {
|
||||
if p.Pattern[0] != '^' {
|
||||
p.Pattern = "^" + p.Pattern
|
||||
}
|
||||
if p.Pattern[len(p.Pattern)-1] != '$' {
|
||||
|
|
Loading…
Reference in a new issue