2023-12-09 06:01:37 +00:00
|
|
|
package domain
|
|
|
|
|
2023-12-09 06:25:53 +00:00
|
|
|
import (
|
|
|
|
"path"
|
|
|
|
)
|
|
|
|
|
2023-12-09 06:01:37 +00:00
|
|
|
type Header struct {
|
2023-12-09 09:44:37 +00:00
|
|
|
Values map[string]string
|
|
|
|
Path string
|
2023-12-09 06:01:37 +00:00
|
|
|
}
|
2023-12-09 06:25:53 +00:00
|
|
|
|
|
|
|
func (h Header) IsMatched(p string) bool {
|
|
|
|
matched, err := path.Match(h.Path, p)
|
|
|
|
if err != nil {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
|
|
|
return matched
|
|
|
|
}
|