format some codes style (#1165)
This commit is contained in:
4
gin.go
4
gin.go
@ -403,8 +403,8 @@ func redirectTrailingSlash(c *Context) {
|
||||
code = 307
|
||||
}
|
||||
|
||||
if len(path) > 1 && path[len(path)-1] == '/' {
|
||||
req.URL.Path = path[:len(path)-1]
|
||||
if length := len(path); length > 1 && path[length-1] == '/' {
|
||||
req.URL.Path = path[:length-1]
|
||||
} else {
|
||||
req.URL.Path = path + "/"
|
||||
}
|
||||
|
Reference in New Issue
Block a user