Skip to content

Commit

Permalink
fix: router sort (#1107)
Browse files Browse the repository at this point in the history
  • Loading branch information
FGYFFFF authored May 9, 2024
1 parent 2d13882 commit a80eadb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/hz/generator/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ func (routerNode *RouterNode) FindNearest(paths []string, method string, sortRou
tmpMethod = method
}
if ("/" + path) == c.Path {
if sortRouter && strings.EqualFold(c.HttpMethod, tmpMethod) {
if sortRouter && !strings.EqualFold(c.HttpMethod, tmpMethod) {
continue
}
i++
Expand Down

0 comments on commit a80eadb

Please sign in to comment.