mirror of
https://github.com/labstack/echo.git
synced 2025-07-15 01:34:53 +02:00
fix index out of bounds if path is empty
This commit is contained in:
@ -69,7 +69,7 @@ func RemoveTrailingSlashWithConfig(config TrailingSlashConfig) echo.MiddlewareFu
|
||||
path := url.Path()
|
||||
qs := url.QueryString()
|
||||
l := len(path) - 1
|
||||
if path != "/" && path[l] == '/' {
|
||||
if l >= 0 && path != "/" && path[l] == '/' {
|
||||
path = path[:l]
|
||||
uri := path
|
||||
if qs != "" {
|
||||
|
Reference in New Issue
Block a user