~netlandish/gobwebs

c7072dba20e47e9198a6c2e0974fcacadae39a7d — Peter Sanchez 2 years ago cf84d97
Moving server Context up the middleware chain
1 files changed, 1 insertions(+), 1 deletions(-)

M server/server.go
M server/server.go => server/server.go +1 -1
@@ 285,7 285,6 @@ func (s *Server) WithDefaultMiddleware() *Server {
	s.e.Pre(middleware.RemoveTrailingSlashWithConfig(middleware.TrailingSlashConfig{
		RedirectCode: http.StatusMovedPermanently,
	}))
	s.e.Use(session.LoadAndSave(s.Session)) // Must be first
	// Set custom context
	s.e.Use(func(next echo.HandlerFunc) echo.HandlerFunc {
		return func(c echo.Context) error {


@@ 293,6 292,7 @@ func (s *Server) WithDefaultMiddleware() *Server {
			return next(ctx)
		}
	})
	s.e.Use(session.LoadAndSave(s.Session)) // Must be first
	s.e.Use(
		middleware.RecoverWithConfig(middleware.RecoverConfig{
			StackSize:    32768, // 32KiB