Trim path ending separators

main
Nikita Tokarchuk 2 years ago
parent dfe60f241a
commit 3cad9177de
Signed by: mainnika
GPG Key ID: A595FB7E3E56911C
  1. 9
      pkg/routes/index.go

@ -38,6 +38,15 @@ func (r *Routes) usePostfixForce(c *routing.Context) (err error) {
return c.Next()
}
fullPath = bytes.TrimRightFunc(fullPath, func(r rune) bool {
switch r {
case '/':
return true
default:
return false
}
})
fullPath = append(fullPath, '.')
fullPath = append(fullPath, []byte(templates.URLPostfix)...)

Loading…
Cancel
Save