Additional code cleanup (see comments on issue #56)

This commit is contained in:
Raphael Simon
2014-05-27 16:37:30 -07:00
parent 3505396fb5
commit 451fd8b779
2 changed files with 9 additions and 13 deletions

View File

@@ -249,7 +249,6 @@ func (v *routeRegexpGroup) setMatch(req *http.Request, m *RouteMatch, r *Route)
}
}
// Store query string variables.
if v.queries != nil && len(v.queries) > 0 {
rawQuery := req.URL.RawQuery
for _, q := range v.queries {
queryVars := q.regexp.FindStringSubmatch(rawQuery)
@@ -260,7 +259,6 @@ func (v *routeRegexpGroup) setMatch(req *http.Request, m *RouteMatch, r *Route)
}
}
}
}
// getHost tries its best to return the request host.
func getHost(r *http.Request) string {

View File

@@ -152,13 +152,11 @@ func (r *Route) addRegexpMatcher(tpl string, matchHost, matchPrefix, matchQuery
if err != nil {
return err
}
if r.regexp.queries != nil {
for _, q := range r.regexp.queries {
if err = uniqueVars(rr.varsN, q.varsN); err != nil {
return err
}
}
}
if matchHost {
if r.regexp.path != nil {
if err = uniqueVars(rr.varsN, r.regexp.path.varsN); err != nil {