🏷️ Added IsMatch method for redirect domain
This commit is contained in:
parent
0c2f6b560b
commit
739a38eb4c
|
@ -1,8 +1,19 @@
|
|||
package domain
|
||||
|
||||
import "path"
|
||||
|
||||
type Redirect struct {
|
||||
From string
|
||||
To string
|
||||
Status int
|
||||
Force bool
|
||||
}
|
||||
|
||||
func (r Redirect) IsMatch(p string) bool {
|
||||
matched, err := path.Match(r.From, p)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
|
||||
return matched
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue