Exemplo n.º 1
0
func (m RegexpRequestMatcher) Match(req *httper.Request, matcher *MatchOption) bool {
	re, err := regexp.Compile(matcher.Pattern)
	if err != nil {
		return false
	}

	result := re.MatchString(req.URL())

	return result
}
Exemplo n.º 2
0
func (m PlainTextRequestMatcher) Match(req *httper.Request, matcher *MatchOption) bool {
	result := (req.URL() == matcher.Pattern)
	return result
}