Fix empty rule
Signed-off-by: Emile Vauge <emile@vauge.com>
This commit is contained in:
parent
606e667b88
commit
fd5352b0c6
1 changed files with 5 additions and 0 deletions
5
rules.go
5
rules.go
|
@ -106,6 +106,11 @@ func (r *Rules) Parse(expression string) (*mux.Route, error) {
|
||||||
"Headers": r.headers,
|
"Headers": r.headers,
|
||||||
"HeadersRegexp": r.headersRegexp,
|
"HeadersRegexp": r.headersRegexp,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(expression) == 0 {
|
||||||
|
return nil, errors.New("Empty rule")
|
||||||
|
}
|
||||||
|
|
||||||
f := func(c rune) bool {
|
f := func(c rune) bool {
|
||||||
return c == ':'
|
return c == ':'
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue