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:
13
echo.go
13
echo.go
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user