Updated ctx to MiddlewareContext in various places.

This commit is contained in:
Travis Reeder
2017-07-12 21:40:16 -07:00
parent 7a81aa5761
commit 86b93e27f7
6 changed files with 20 additions and 23 deletions

View File

@@ -100,6 +100,8 @@ func (s *Server) middlewareWrapperFunc(ctx context.Context) gin.HandlerFunc {
}
ctx = c.MustGet("ctx").(context.Context)
fctx := &middlewareContextImpl{Context: ctx}
// add this context to gin context so we can grab it later
c.Set("mctx", fctx)
fctx.index = -1
fctx.ginContext = c
fctx.middlewares = s.middlewares