Skip to content

Commit

Permalink
fix an issue when r.RedirectTrailingSlash = false
Browse files Browse the repository at this point in the history
Signed-off-by: Toby Yan <me@tobyan.com>
  • Loading branch information
toby1991 committed Jul 10, 2019
1 parent e5a0c7c commit 7464216
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions route/group.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ func (g *group) AddGroup(relativePath string, routeGrouper RouteGrouper, handler
}

func (g *group) clearPath(relativePath string) string {
if relativePath == "" {
return relativePath
}

basePath := g.RouterGroup.BasePath()
if basePath[len(basePath)-1:] == "/" && relativePath[:1] == "/" {
return relativePath[1:]
Expand Down

0 comments on commit 7464216

Please sign in to comment.