🏷️ Added IsMatched method for Header domain
This commit is contained in:
parent
10be636a05
commit
f73500580a
|
@ -1,6 +1,19 @@
|
||||||
package domain
|
package domain
|
||||||
|
|
||||||
|
import (
|
||||||
|
"path"
|
||||||
|
)
|
||||||
|
|
||||||
type Header struct {
|
type Header struct {
|
||||||
Headers map[string]string
|
Headers map[string]string
|
||||||
Path string
|
Path string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (h Header) IsMatched(p string) bool {
|
||||||
|
matched, err := path.Match(h.Path, p)
|
||||||
|
if err != nil {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
return matched
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue