Skip to content

Commit

Permalink
update param name
Browse files Browse the repository at this point in the history
  • Loading branch information
jranson committed Aug 12, 2024
1 parent f184a81 commit b4647bf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions pkg/router/lm/lm.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func (rt *rtr) ServeHTTP(w http.ResponseWriter, r *http.Request) {
}

func (rt *rtr) RegisterRoute(path string, hosts, methods []string,
isWildcard bool, handler http.Handler) error {
matchPrefix bool, handler http.Handler) error {
pl := len(path)
if pl == 0 {
return errors.ErrInvalidPath
Expand All @@ -61,7 +61,7 @@ func (rt *rtr) RegisterRoute(path string, hosts, methods []string,
}
rt.routes[h] = hrc
}
if !isWildcard {
if !matchPrefix {
rl, ok := hrc.ExactMatchRoutes[path]
if rl == nil || !ok {
rl = make(router.RouteLookup)
Expand Down Expand Up @@ -127,7 +127,7 @@ func (rt *rtr) RegisterRoute(path string, hosts, methods []string,
return nil
}

// this sorts the prefix-match paths longest to shorted
// this sorts the prefix-match paths longest to shortest
func (rt *rtr) sort() {
for _, hrc := range rt.routes {
if len(hrc.PrefixMatchRoutes) == 0 {
Expand Down
2 changes: 1 addition & 1 deletion pkg/router/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ type Router interface {
// ServeHTTP services the provided HTTP Request and write the Response
ServeHTTP(http.ResponseWriter, *http.Request)
// RegisterRoute registers a handler for the provided path/host/method(s)
RegisterRoute(path string, hosts, methods []string, isWildcard bool,
RegisterRoute(path string, hosts, methods []string, matchPrefix bool,
handler http.Handler) error
// Handler returns the handler matching the method/host/path in the Request
Handler(*http.Request) http.Handler
Expand Down

0 comments on commit b4647bf

Please sign in to comment.