Trim path ending separators

This commit is contained in:
2022-02-02 22:46:29 +01:00
parent dfe60f241a
commit 3cad9177de
+9
View File
@@ -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)...)