Exemple #1
0
func (r *hostUrlWildcardRule) match(req *http.Request) bool {
	if r.only_http && strings.EqualFold(req.Method, "Connect") {
		return false
	}
	if ret := util.WildcardMatch(req.Host, r.host_rule); !ret {
		return false
	}
	if len(r.url_rule) > 0 {
		return util.WildcardMatch(req.URL.RequestURI(), r.url_rule)
	}
	return true
}
Exemple #2
0
func (r *urlWildcardRule) match(req *http.Request) bool {
	return util.WildcardMatch(util.GetURLString(req, false), r.url_rule)
}