Skip to content

Commit

Permalink
Fix defining multiple subscriptions on root path
Browse files Browse the repository at this point in the history
  • Loading branch information
Maciej Winnicki committed Jun 27, 2018
1 parent 5e02910 commit 65d5a1c
Show file tree
Hide file tree
Showing 3 changed files with 192 additions and 183 deletions.
8 changes: 6 additions & 2 deletions internal/pathtree/tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,12 @@ 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
} else {
return fmt.Errorf("route / conflicts with existing route")
}
}

segments := toSegments(route)
Expand Down
Loading

0 comments on commit 65d5a1c

Please sign in to comment.