diff --git a/middleware/public.go b/middleware/public.go index f96c43c..97f4d6c 100644 --- a/middleware/public.go +++ b/middleware/public.go @@ -81,7 +81,7 @@ func (tr *MiddlewareRegistry) Add(pluginName string) error { } /* (6) Cast Inspect */ - inspectCast, ok := inspect.(func(http.Request, Scope)) + inspectCast, ok := inspect.(func(http.Request, *Scope)) if !ok { return fmt.Errorf("Inspect() is malformed") } @@ -102,7 +102,7 @@ func (mr MiddlewareRegistry) Run(req http.Request) Scope { /* (2) Execute each middleware */ for _, m := range mr.Middlewares { - m.Inspect(req, scope) + m.Inspect(req, &scope) } return scope diff --git a/middleware/types.go b/middleware/types.go index f2ab731..d1ec871 100644 --- a/middleware/types.go +++ b/middleware/types.go @@ -11,12 +11,12 @@ type Scope []string // Inspector updates the @Scope passed to it according to // the @http.Request -type Inspector func(http.Request, Scope) +type Inspector func(http.Request, *Scope) // Middleware contains all necessary methods // for a Middleware provided by user/developer type MiddleWare struct { - Inspect func(http.Request, Scope) + Inspect func(http.Request, *Scope) } // MiddlewareRegistry represents a registry containing all registered