Skip to content

Commit

Permalink
Fix defining multiple subscriptions on root path (#472)
Browse files Browse the repository at this point in the history
  • Loading branch information
mthenw committed Jun 27, 2018
1 parent 5e02910 commit a0794b2
Show file tree
Hide file tree
Showing 3 changed files with 191 additions and 183 deletions.
7 changes: 5 additions & 2 deletions internal/pathtree/tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@ type Params map[string]string
// nolint: gocyclo
func (n *Node) AddRoute(route string, value interface{}) error {
if route == "/" {
n.value = value
return nil
if n.value == nil {
n.value = value
return nil
}
return fmt.Errorf("route / conflicts with existing route")
}

segments := toSegments(route)
Expand Down
Loading

0 comments on commit a0794b2

Please sign in to comment.