fix: rules parsing

This commit is contained in:
Henrique Dias
2024-07-22 22:25:50 +02:00
parent 732cf5eff5
commit 947b163ea7
2 changed files with 30 additions and 2 deletions
+2 -1
View File
@@ -31,6 +31,7 @@ func (r *Rule) Validate() error {
}
r.Regexp = rp
r.Path = ""
r.Regex = false
}
return nil
@@ -38,7 +39,7 @@ func (r *Rule) Validate() error {
// Matches checks if [Rule] matches the given path.
func (r *Rule) Matches(path string) bool {
if r.Regex {
if r.Regexp != nil {
return r.Regexp.MatchString(path)
}