~netlandish/gobwebs

a73ff3f34f4d9eb43ceb094c7485f910ba9a25a2 — Peter Sanchez 2 years ago d4dceb4
Removing trailing slash middleware
1 files changed, 3 insertions(+), 3 deletions(-)

M server/server.go
M server/server.go => server/server.go +3 -3
@@ 283,9 283,9 @@ func (s *Server) WithDefaultMiddleware() *Server {
	if s.Session == nil {
		panic(fmt.Errorf("You must call Initialize before WithDefaultMiddleware"))
	}
	s.e.Pre(middleware.RemoveTrailingSlashWithConfig(middleware.TrailingSlashConfig{
		RedirectCode: http.StatusMovedPermanently,
	}))
	//s.e.Pre(middleware.RemoveTrailingSlashWithConfig(middleware.TrailingSlashConfig{
	//    RedirectCode: http.StatusMovedPermanently,
	//}))
	// Set custom context
	s.e.Use(func(next echo.HandlerFunc) echo.HandlerFunc {
		return func(c echo.Context) error {