Skip to content

Commit

Permalink
Compile matcher on adding route to existing host
Browse files Browse the repository at this point in the history
  • Loading branch information
sharbov committed Mar 6, 2018
1 parent 6b7a0ef commit 1eb27b9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion route/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,11 @@ func (t Table) addRoute(d *RouteDef) error {

// add new route to existing host
case t[host].find(path) == nil:
r := &Route{Host: host, Path: path}
g, err := glob2.Compile(path)
if err != nil {
return err
}
r := &Route{Host: host, Path: path, Glob: g}
r.addTarget(d.Service, targetURL, d.Weight, d.Tags, d.Opts)
t[host] = append(t[host], r)
sort.Sort(t[host])
Expand Down

0 comments on commit 1eb27b9

Please sign in to comment.