Improve subroute configuration propagation #422

* Pull out common shared `routeConf` so that config is pushed on to child
routers and routes.
* Removes obsolete usages of `parentRoute`
* Add tests defining compositional behavior
* Exercise `copyRouteConf` for posterity
This commit is contained in:
Joe Wilner
2018-12-07 10:48:26 -05:00
committed by Matt Silverlock
parent 3d80bc801b
commit 758eb64354
4 changed files with 511 additions and 170 deletions

View File

@@ -267,7 +267,7 @@ type routeRegexpGroup struct {
}
// setMatch extracts the variables from the URL once a route matches.
func (v *routeRegexpGroup) setMatch(req *http.Request, m *RouteMatch, r *Route) {
func (v routeRegexpGroup) setMatch(req *http.Request, m *RouteMatch, r *Route) {
// Store host variables.
if v.host != nil {
host := getHost(req)