Beispiel #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
}
Beispiel #2
0
func (m PlainTextRequestMatcher) Match(req *httper.Request, matcher *MatchOption) bool {
	result := (req.URL() == matcher.Pattern)
	return result
}