1
0
mirror of https://github.com/labstack/echo.git synced 2025-12-21 23:57:40 +02:00

StripTrailingSlash is now an option

Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
Vishal Rana
2015-09-01 08:03:01 -07:00
parent 9b36defadf
commit 507c69ec80
8 changed files with 57 additions and 87 deletions

13
echo.go
View File

@@ -34,6 +34,7 @@ type (
renderer Renderer
pool sync.Pool
debug bool
stripTrailingSlash bool
router *Router
}
@@ -248,14 +249,14 @@ func (e *Echo) SetRenderer(r Renderer) {
e.renderer = r
}
// SetDebug sets debug mode.
func (e *Echo) SetDebug(on bool) {
e.debug = on
// Debug enables debug mode.
func (e *Echo) Debug() {
e.debug = true
}
// Debug returns debug mode.
func (e *Echo) Debug() bool {
return e.debug
// StripTrailingSlash enables removing trailing slash from the request path.
func (e *Echo) StripTrailingSlash() {
e.stripTrailingSlash = true
}
// Use adds handler to the middleware chain.