Fix empty rule

Signed-off-by: Emile Vauge <emile@vauge.com>
This commit is contained in:
Emile Vauge 2016-06-22 22:07:02 +02:00
parent 606e667b88
commit fd5352b0c6
No known key found for this signature in database
GPG key ID: D808B4C167352E59

View file

@ -106,6 +106,11 @@ func (r *Rules) Parse(expression string) (*mux.Route, error) {
"Headers": r.headers,
"HeadersRegexp": r.headersRegexp,
}
if len(expression) == 0 {
return nil, errors.New("Empty rule")
}
f := func(c rune) bool {
return c == ':'
}