Skip to content

Commit

Permalink
- Fix not found routers bug
Browse files Browse the repository at this point in the history
- Improved performance (little)
  • Loading branch information
legion-zver committed Jun 1, 2018
1 parent 8797498 commit 2a03b8b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions just.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
)

const (
Version = "v0.1.14"
Version = "v0.1.15"
DebugEnvName = "JUST_DEBUG_MODE"
)

Expand Down Expand Up @@ -247,12 +247,14 @@ func (app *application) handleRouter(router *Router, httpMethod, path string, c
}
// Поиск следующего роутера
if router.groups != nil && len(router.groups) > 0 {
for relativePath, r := range router.groups {
if strings.Index(relativePath, "{") >= 0 && r.rxPath != nil {
for _, r := range router.groups {
if strings.Index(r.basePath, "{") >= 0 && r.rxPath != nil {
if _, ok := r.CheckPath(path); ok {
return app.handleRouter(r, httpMethod, path, c)
}
} else if strings.Index(path, joinPaths(router.basePath, relativePath)) >= 0 {
continue
}
if strings.Index(path, r.basePath) >= 0 {
return app.handleRouter(r, httpMethod, path, c)
}
}
Expand Down

0 comments on commit 2a03b8b

Please sign in to comment.