mirror of
https://github.com/mainnika/nikita-tokarch-uk.git
synced 2026-05-25 01:03:35 +00:00
Trim path ending separators
This commit is contained in:
@@ -38,6 +38,15 @@ func (r *Routes) usePostfixForce(c *routing.Context) (err error) {
|
|||||||
return c.Next()
|
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, '.')
|
||||||
fullPath = append(fullPath, []byte(templates.URLPostfix)...)
|
fullPath = append(fullPath, []byte(templates.URLPostfix)...)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user